1
I’m trying to use a datePicker
with array input, as there are 5 validity fields, which I will insert with PHP in an Oracle database. Using the option class
the datePicker
is called, but it only saves the value in the first input. By clicking on the following it changes in the first, always. Any hint?
Datepicker:
$(function() {
$(".validade_treinamento").datepicker({
minDate: 0, //NÃO PERMITIR DATA MENOR QUE A ATUAL
dateFormat: 'dd/mm/yy',
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']
});
});
Call in inputs:
<input type = "text" id="validade_treinamento[]" name = "validade_treinamento[]" class="validade_treinamento" placeholder="Clique Aqui" size = 10 maxlength = 10 disabled>
Example
I didn’t understand that:
id="validade_treinamento[]"
... since an id should be unique on the page, I see no point in using as an array.– Sam
@dvd I have 5 equal fields, which I need to treat in PHP as an array for future insertion.
– Diego
Yes, the array should only be used in
name
.– Sam
You’re right, I changed your answer and it worked. Thank you very much!
– Diego