Datebox - get the event and validate year, month, and date by entering a value manually

405 views Asked by At

I am using datebox plugin for jquery mobile http://dev.jtsage.com/jQM-DateBox2/unit/datebox.html

Everything works fine.

Here my question is how do i validating the individual year, month, date input fields by entering the numeric values in the specific fields ((ie) keydown/keypress..) without using of plus and minus buttons.

Thanks in advance...

1

There are 1 answers

0
nbar On

This function checks if the input changed and logs the new date into the console.log:

$("div.ui-grid-b div input.ui-input-text").change(function() {
    var parent = $(this).parent().parent();
    console.log("date changed to: "
               +parent.find("div.ui-block-a input.ui-input-text").val()+":"
               +parent.find("div.ui-block-b input.ui-input-text").val()+":"
               +parent.find("div.ui-block-c input.ui-input-text").val()
               );

});