jquery prevent textbox clear

i'm using the jquery masked input plugin
http://digitalbush.com/projects/masked-input-plugin/

In my jquery code i currently set the date mask like this and it works fine:

$('.StartDate').mask("99/99/9999");

I have 3 textboxes who have class="StartDate" set on them.
So the mask gets applied to the three textboxes.

On page load they have default values of

10/12/2017
10/13/2017
10/14/2017

But I noticed that when I click the left mouse button in one of the textboxes. The default values gets cleared out from the other two textboxes.

Do you guys know what jquery event gets fired when I click inside a textbox with the left mouse button?

How do I prevent the textboxes from clearing the default values ?
LVL 1
maqskywalkerAsked:
Who is Participating?
 
Ryan ChongCommented:
But I noticed that when I click the left mouse button in one of the textboxes. The default values gets cleared out from the other two textboxes.
what if you return to the control's id instead?

$("#date1").mask("99/99/9999");
$("#date2").mask("99/99/9999");
$("#date3").mask("99/99/9999");

Open in new window


try post your html here if necessary.
0
 
Anthony PangilinanDeveloperCommented:
Ryan Chong's solution should work for you. If you need to find out what JS events are bound to certain elements, this bookmarklet helps. It's a little clunky, but useful.
0
 
Ryan ChongCommented:
do you need further assistance here?
0
 
Ryan ChongCommented:
as proposed
0
 
maqskywalkerAuthor Commented:
Please close. Case has been resolved. Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.