hi i want validations for two drop down lists. when user
enter to second list by skipping first list alert box should
appear.

<HTML><HEAD>
<TITLE>drop down validation</TITLE>

<script type="text/javascript">


function validateForm(){
if(document.ItemList.Item.selectedIndex==0)
{
alert("Please select item from first list.");
document.ItemList.Item.focus();
return false;
}
return true;
}

</SCRIPT>
</HEAD>

<BODY>
Please choose an item from the drop down menu:

<form name="ItemList" method="post" action="asp.html"
onsubmit="validateForm()">
<table width="100%" border="0">
<tr>
<td width="135">Choose a username: </td>
<td>
<select name="Item">
<option value selected> SELECT </option>
<option value>Apples</option>
<option value>Oranges</option>
</select>

<table width="100%" border="0">
<tr>
<td width="135">Choose a username: </td>
<td>
<select name="Item" onclick="validateForm()">
<option value selected> SELECT </option>
<option value>Apples</option>
<option value>Oranges</option>
</select>

<input type="submit" name="Submit" value="Submit">
</td></tr></table></form>
</BODY>
</HTML>
please any body help me
thanks


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More JavaScript Interview Questions

How to set the cursor to wait?

0 Answers  


Can webassembly replace javascript?

0 Answers  


How can a page be forced to load another page in javascript?

0 Answers  


Explain the steps for connecting the system to Internet.

0 Answers   Annamalai University,


How to port a GUI application onto Web

0 Answers   TCS,






What is the most popular javascript library?

0 Answers  


What will happen if an infinite while loop is run in Javascript?

0 Answers  


What is use of flutter?

0 Answers  


Define unescape() and escape() functions?

0 Answers  


List some design patterns in javascript?

0 Answers  


What is a closure in javascript?

0 Answers  


What is variable typing?

0 Answers  


Categories