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

What is the use of ‘debugger’ keyword in javascript code?

0 Answers  


HI friends .am Mohammed Riyash.JMC BCA Tricy. My doubt is. In some websites like bloomberg.com..etc. when MouseOver() action performed.the menuitems will be drop down..and hides when blur()action happened.any body give the code for that..

1 Answers   iGate, Reliance,


Is it possible to use javascript to change the meta-tags of the page?

0 Answers  


What is stack queue?

0 Answers  


Why typeof null is object?

0 Answers  






Is javascript object a hash table?

0 Answers  


How to add a combo box dynamically at run time in Java script?

5 Answers  


What is nodetype in javascript?

0 Answers  


Is javascript array dynamic?

0 Answers  


how many feet does a centipeed have?

0 Answers  


Is a javascript script faster than an asp script?

0 Answers  


write a program to generte a harmonic series 1+1/2+1/3+1/4+1/5 upto 15 terms.

1 Answers  


Categories