2
I am finishing a registration page and realized that jQuery Calendar after loading for the second time does not work.
$(function() {
//Mascaras para Calendário....
$( "#datepicker10,#datepicker11,#datepicker12,#datepicker00" ).datepicker({
showOn: "button",
buttonImage: "images/icon_calendario.png",
changeMonth: true,
changeYear: true,
dayNames: ['Domingo','Segunda','Terça','Quarta','Quinta','Sexta','Sábado','Domingo'],
dayNamesMin: ['D','S','T','Q','Q','S','S','D'],
dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb','Dom'],
monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],
yearRange: '1900:2100'
});
});
HTML code:
<label>Data Admissão: </label> <span> <? echo $linha['DataAdmissao']; ?> </span>
<div class="">
<input class="" id="datepicker10" name="DataAdmissao" type="text" />
</div>
The code works once on the page, but when I use the ajax feature the calendar does not appear. What will be the problem ?
Alex, elements that have a calendar are rewritten when running AJAX?
– Sergio
Supplementing @Sergio’s question: Are new calendars inserted into the page via ajax? The application of
datepicker
is not retroactive, if you replace or insert new calendars, you need to apply datepicker manually after this operation.– bfavaretto