Wednesday 15 August 2012

jquery -- one datepicker and one timepicker cannot work on one page -


I have two input boxes on one page, one uses the datepicker and the other uses the timepicker.

If I have an invalid time in the input input box, this reset will reset the date box.

Anyone can help me fix this bug?

Thanks

  & lt; Input value = "2012-11-20" data-val-regex-pattern = "^ \ d {4} (\ -) \ d {2} (\ -) \ d {2} $" id = "hampendet" Name = "hampendet" type = "text" value = "" /> & Lt; Input value = "08: 14: 02.600" data-val = "true" data-val-reggex-pattern = "^ \ d {2} (:) \ d {2} (:) \ d {2} (. ) \ D {1,3} $ "id =" happenetime "name =" happenetime "type =" text "value =" "/> & Lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ ("input # hasband"). Datepicker ();}); $ (Document) .ready (function () {$ ("input # happenTime"). Timepicker ({showSecond: true, showMillisec: true, stepMillisec: 100, timeFormat: 'HH: mm: ss.l'});} ); & Lt; / Script & gt;    

Use only one $ (document) .ready (function)

No comments:

Post a Comment