nanatiris / jquery-watermark

Automatically exported from code.google.com/p/jquery-watermark
0 stars 0 forks source link

Set focus to watermarked textbox on button click #39

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I was trying to use the watermark plug-in for jquery Version 3.0.6.

When I apply the watertext for input conrol it is working fine.
But when I am trying to set the focus for the watermarked input control on the 
button click event, focus will be at the end of the watermark and when I try to 
key-in some text it is appending to the watermarked text.

I am trying for to integrate watermark for asp.net textbox control.

Please find the attached HTMl source for the same to reproduce.

Note:To reproduce just the change the path of the Jquery and watermark script 
files.

Please let me know your suggestions to solve the above issue.

Thanks 
Prabahakr

Original issue reported on code.google.com by prabhaka...@gmail.com on 26 Oct 2010 at 12:15

GoogleCodeExporter commented 9 years ago
You are using a third-party JavaScript function to set the focus to the text 
box, rather than simply focusing it directly.

Instead of using WebForm_AutoFocus('MyTextBox2'); at the bottom of your page, 
use:

$("#MyTextBox2").focus();

Original comment by t...@speednet.biz on 3 Dec 2010 at 3:57