Click here to Skip to main content
15,390,740 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

What is the function code of the following program..?

<script type="text/javascript">
function update_list()
var lists = new Array();
lists['punjab']  = new Array();
lists['punjab'][0] = new Array('Barnala','Sangrur','Bathinda');

lists['Haryana']    = new Array();
lists['Haryana'][0] = new Array('Ambala','Hisar','Shabad');

       lists['Maharastra']= new Array();
 lists['Maharastra'][0] = new Array('Mumbai','pune');
 function initList()
<form name="myform" id="myform">
<select name="myselect" id="myselect" >
<option >--select--<option>
<option value="1">Punjab</option>
<option value="2">Haryana </option>
<option value="3"> Maharastra</option>
<select name="myselects" id="myselects"></select>
Updated 12-Aug-10 3:09am
Dalek Dave 12-Aug-10 9:11am
Edited to correct the Code Block

I looks very much like you are presented with a form from which you select a Region, and dependant upon which region you select you are offered a more detailed area selection.

Also you should delete the previous incomplete version of this question, it is bad form to ask twice.
Well, Javascript is not hooked up anywhere so, a form with two dropdowns.
First one with 3 values (Punjab, Haryana, Maharashtra). Second one empty.
Thats it.

P.S. If Javascripts are written completekly and hooked to dropdown change event, code is moving towards 'Cascading Dropdown'.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900