I have a big form with at least 5 input date forms.
For example:
<input type="text" id="nameClient" name="nameClient"/>
<input type="text" id="nameRouterID" name="nameRouerID"/>
<input type="text" id="dateInstallation" name="dateInstallation"/>
<input type="text" id="dateConfiguration" name="dateConfiguration"/>
<input type="text" id="dateConfirmationClient" name="dateConfirmationClient"/>
Well, i want to search the entire DOM for %date% word and apply datepicker jQuery plugin, avoiding to create this following lines for each element
<script>
$( "#dateInstallation" ).datepicker();
$("#dateInstallation").datepicker("option", {dateFormat: "dd/mm/yy", changeMonth: true, changeYear: true});
});
</script>';
I think it's possible to know with .find() function and "this" relative, but i'm not familiar. I think is something like this:
$( "text" ).find( "%date%" ).datepicker();
And later:
$(this).datepicker("option", {dateFormat: "dd/mm/yy", changeMonth: true, changeYear: true});
But i can't get it work I am not sure whether it is syntax problem or other
<input type="text" id="dateConfiguration" class="dateInput" name="dateConfiguration"/>, and then$('.dateInput').datepicker()?