jquery prevent textbox clear

maqskywalker
maqskywalker used Ask the Experts™
on
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 ?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software Team Lead
Commented:
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.
Commented:
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.
Ryan ChongSoftware Team Lead

Commented:
do you need further assistance here?
Ryan ChongSoftware Team Lead

Commented:
as proposed

Author

Commented:
Please close. Case has been resolved. Thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial