i'm here with a little issue, that i can't solve
Code: Select all
echo "<td><select id=\"message\" onChange=\"alert(this.value)\">"; // here i can get the right value everytime that i change it
while( $row1 = mysql_fetch_array($result1, MYSQL_ASSOC) ) {
echo "<option value=\"".$row1['id_message']."\">".$row1['id_message'] . "-" . $row1['desc']."</option>";
}
echo "</select></td>";
Code: Select all
var index = document.getElementById("message").selectedIndex;
alert(document.getElementById("message").options[index].value);
thanks in advance