Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

hi i want validations for two dropdown lists in java
script.when user enter to second dropdown list by skipping
first dropdown list we should get alert box. please help me
very urgent

Answer Posted / sasi5586



<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>

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does the instanceof operator do?

1009


a code in vb script, which creates a table of 5*2 in html this is a static table, one more same dynamic table, as we give input the table should get created.

1556


What is Associative Array? How do we use it?

1032


Explain higher-order functions in javascript?

904


What is closure?

1086


What is the use of a map object in javascript?

956


how to validate the date(dd/mm/yyyy)using regular expression in javascript? It should also satisfy the leap year feb 29 problem. Please help me.

6291


What is the use of a set object in javascript?

937


Explain what is pop()method in JavaScript?

1201


how to get no of items from from weblist?

1890


What is javascript and its advantages?

1007


Does apple use javascript?

849


How to redirect a url using JavaScript?

1099


What is the importance of javascript?

930


What is node ecosystem?

871