EDIT:
With the hints on the responses i got to know that name isn’t a valid attribute for div tag, but it’s for select.
function modifica(estado,numero){
alert(numero);
$.ajax({
type: "GET",
datatype: "html",
url: "icallverifica.php",
data: {
estado : estado,
modifica : "1" ,
numero : numero
},
success: function(data) {
alert(data);
}
});
}
So, i want to get multiple attributes at once using onchange:
if($valor == 0){
mysql_select_db("iloja_icall", $con);
$result1 = mysql_query("SELECT * FROM icall WHERE verifica='0'");
while($row = mysql_fetch_array($result1)){
echo $row['numero'].'<select id="optin" name="'.$row['numero'].'" onchange="modifica(this.value,this.name)">
<option value="chamada">Chamada</option>
<option value="atendeu">Atendeu</option>
<option value="atendeunao">Nao atendeu</option>
<option value="engano">Engano</option>
</select>';
echo '<br>';
}
}
THIS COMBO IS NOW WORKING FLAWLESSLY 😀 THANK YOU SO MUCH GUYS, this is why i love stackoverflow 🙂
Shouldn’t this work?
Thanks so much guys!
Based on the tags for this question, I see you’re using jQuery.
Additionally, you could just remove the
onchangeattribute and set it with an even listener (recommended):If you want to iterate (loop) through all of an element’s attributes, then check out this: How to iterate through all attributes in an HTML element?