This is a follow-up question to this question:
Actually I I use a text box (edit: link can no longer be on relevant version)
When the masked input text box receives focus, I want to select all the contents of that textbox , But it seems that this plugin prevents it from being embedded in a textbox. I was just thinking that its a She had a way.
Below is a sample. HTML page that shows this issue:
& lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; & Lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Input id = "masktest" type = "text" value = "01/01/2009" /> & Lt; Br / & gt; & Lt; Input id = "focustest" type = "text" value = "select all the content on focus ..." /> & Lt; Script type = "text / javascript" src = "http://code.jquery.com/jquery-latest.min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "http://jquery-joshbush.googlecode.com/files/jquery.maskedinput-1.2.1.pack.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; $ (Function () {$ ("# maskatet") mask ("99/99/9999"); // The contents of the text box will be selected when receiving focus. $ ("Input [type = text]") Focus (function () {$ (this). Selection ();}}}}}; & Lt; / Script & gt; & Lt; / Body & gt; & Lt; / Html & gt;
I'm the author for jQuery. I decided that this should be the default behavior for the complete mask and I got it in the latest release. You can read the details
Comments
Post a Comment