Forum Moderators: open
<body>
<form method="POST" action="--WEBBOT-SELF--">
<p> </p>
<p> </p>
<table border="1" width="100%">
<tr id="glow">
<td width="324" > </td>
<td><select size="1" name="D1" onclick="check(this.value)" id="abc">
<option value="green">A</option>
<option value="red">B</option>
<option selected value="gray">C</option>
</select></td>
</tr>
<tr>
<td width="324"> </td>
<td> </td>
</tr>
<tr>
<td width="324"> </td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
-----------------------------------------------------------
This code is working successfully on Desktop PC(on IE) but it is not working on Windows Mobile 5.0(Mobile IE).(Colors are changed on Desktop but not on(WM 5.0)).
Kindly guide me how can i use onclick() javascript event on Windows Mobile 5.0.
I'm not familiar with the javascript quirks of Windows Mobile 5.0. One thing I would check is to see if the onclick event is firing at all. replacing your onclick with something like this would tell you if it's firing at all:
onclick="alert(this.value);"
If the onclick doesn't fire at all, it may be a problem with what type of elements that browser allows the onclick event for. Since it's a select, you could try the "onchange" event.
IE does not handle
onclick on select elements, if I remember correctly, although FF does. Looking at your code, I honestly cannot see why
onchange would not work. Seems like it should. For that matter, seems like you should be able to make it work otherwise. Perhaps if you told us why
onchange does not fulfill your purpose?
Fix your code instead. Add a blank option so that the user is forced to change to A, B, or C.
Onclick does not work on a select anyway, so it is not like there is an option. Either:
a) live with the fact that an unchanged select box results in no changes being made
or
b) force the select box to be changed