Clearing jQueryMobile DateBox value from an event

811 Views Asked by At

I have 2 DateBox (from & to). What I want to do is whenever I click on the "from" DateBox it will always clear the "to" DateBox.

I'm looking at the doclear method and I'm not sure if it is the right one or even know how to use it.

Just to be clear I'm using this.

Any help would be appreciated. Thanks!

1

There are 1 best solutions below

2
On BEST ANSWER

In my testing setting the value of the box to an empty string ('') works. Assuming id of fromDate and toDateon the two boxes the following code should do the trick:

$('#fromDate').click(function(){
    $('#toDate').val('');
}