Javascript Action On Click
I have few generated text fields. I want to show datepicker on text field click. });
you dont need to use click
method
demo
$( "input" ).datepicker({ dateFormat: 'yy-mm-dd ' });
<scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><scriptsrc="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script><inputid="id_validity_set-0-valid_until"name="validity_set-0-valid_until"type="text" /><inputid="id_validity_set-1-valid_until"name="validity_set-1-valid_until"type="text" /><inputid="id_validity_set-2-valid_until"name="validity_set-2-valid_until"type="text" />
Solution 2:
$(document).ready(function ()
{
$("input[type = 'text']").datepicker({
dateFormat: 'yy-mm-dd '
});
});
Post a Comment for "Javascript Action On Click"