how to validate a dropdown box in javascript

Posted by Shanky11 under ASP.NET on 10/26/2012 | Points: 10 | Views : 924 | Status : [Member] | Replies : 1
how to validate a dropdown box in javascript




Responses

Posted by: Deepraj on: 10/26/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,
HTML select tag have OnChange event in javascript ,using that you can you can write validation you need.
Here is the example code.

<html>

<head>
<script type="text/javascript" language="javascript">
alert("he");
function hai()
{
alert("hai");
}

</script>
</head>
<body>

<select onchange="hai()">
<option>hay</option>
<option>hae</option>
<option>hai</option>
<option>hat</option>
</select>
</body>
</html>




Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response