I Think that I have a problem, I have a table where every is a form and when I change the "select" the update without change the page
the problem that the query upadte only the first row why? chrome write me "Found 152 elements with non-unique id #DO20_FLGST1..." not accept multi form?
$risultato = sqlsrv_query($conn, $interrogazione);
while ($riga = sqlsrv_fetch_array($risultato, SQLSRV_FETCH_ASSOC)) {
<form name='contact' action=''>
<select name="DO20_FLGST1" id="DO20_FLGST1" >
<option value='no' <?=$check0;?>>No</option>
<option value='cc' <?=$check1;?>>ComeCli</option>
<option value='co' <?=$check2;?>>Contrass</option>
</select>
<input type=hidden name=numreg id='numreg' value="<?=$riga['DO11_NUMREG_CO99'];?>">
<input type=hidden name=do20_flag id='do20_flag' value='do20_flag'>
<input name='DO20_NUMST1' type='text' size=4 id='DO20_NUMST1' value='<?=$riga['DO20_NUMST1'];?>'>
<input name='cliente' type='hidden' id='cliente' value='<?=$riga['CG16_RAGSOANAG']." ".$riga['DO11_NUMDOC']."/".$riga['DO11_SEZDOC'];?>'>
</form>
}
$(document).ready(function () {
$(document).on("change", "select#DO20_FLGST1", function(){
var do20_flag = $('#do20_flag').val();
var numreg = $('#numreg').val();
var DO20_NUMST1 = $('#DO20_NUMST1').val();
var DO20_FLGST1 = $('#DO20_FLGST1').val();
$.ajax({
url: 'salva.php',
type: "post",
data: { "do20_flag": do20_flag, "numreg": numreg, "DO20_NUMST1": DO20_NUMST1, "DO20_FLGST1": DO20_FLGST1},
success: function(response) {
alert('Hai modificato '+$('#cliente').val());
}
});
}); });