OnChange Dropdown Changing Variables

The dropdown works with the java script function, which allows the variables to change respective to the selection of dropdown.

Click here to view the code

— Code Starts here —-

 
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN””http://www.w3.org/TR/html4/loose.dtd”>

<html>

<head>

<title>Untitled Document</title>

<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>

<script type=”text/javascript”>

var i;

function fill_drpCourse(i){

var form1 = document.getElementById(“form1″);

form1.drpCourse.options.length=0;

switch(i)

{

case 0:

form1.drpCourse.options[0] =new Option(‘Select Course’,’Select Course’);
break;

case 1:

form1.drpCourse.options[0] =new Option(‘B.A’,’B.A’);

form1.drpCourse.options[1] =new Option(‘B.COM’,’B.COM’);

form1.drpCourse.options[2] =new Option(‘B.Lis’,’B.Lis’);

form1.drpCourse.options[3] =new Option(‘B.Sc’,’B.Sc’);

form1.drpCourse.options[4] =new Option(‘BBA’,’BBA’);

form1.drpCourse.options[5] =new Option(‘BCA’,’BCA’);

form1.drpCourse.options[6] =new Option(‘M.A’,’M.A’);

form1.drpCourse.options[7] =new Option(‘M.COM’,’M.COM’);

form1.drpCourse.options[8] =new Option(‘M.Lis’,’M.Lis’);

form1.drpCourse.options[9] =new Option(‘M.Sc’,’M.Sc’);

form1.drpCourse.options[10] =new Option(‘MBA’,’MBA’);

form1.drpCourse.options[11] =new Option(‘P.G.Diploma’,’P.G.Diploma’);
break;

case 2:

form1.drpCourse.options[0] =new Option(‘B.A’,’B.A’);

form1.drpCourse.options[1] =new Option(‘B.COM’,’B.COM’);

form1.drpCourse.options[2] =new Option(‘BBM’,’BBM’);

form1.drpCourse.options[3] =new Option(‘M.A’,’M.A’);

form1.drpCourse.options[4] =new Option(‘M.COM’,’M.COM’);
break;

case 3:

form1.drpCourse.options[0] =new Option(‘SSLC’,’SSLC’);

break;

case 4:

form1.drpCourse.options[0] =new Option(‘B.A’,’B.A’);

form1.drpCourse.options[1] =new Option(‘B.COM’,’B.COM’);

form1.drpCourse.options[2] =new Option(‘B.Lis’,’B.Lis’);

form1.drpCourse.options[3] =new Option(‘B.Sc’,’B.Sc’);

form1.drpCourse.options[4] =new Option(‘BBA’,’BBA’);

form1.drpCourse.options[5] =new Option(‘BCA’,’BCA’);

form1.drpCourse.options[5] =new Option(‘BSW’,’BSW’);

form1.drpCourse.options[6] =new Option(‘Diploma’,’Diploma’);

form1.drpCourse.options[7] =new Option(‘EMBA’,’EMBA’);

form1.drpCourse.options[8] =new Option(‘Fashion Designing’,’Fashion Designing’);

form1.drpCourse.options[9] =new Option(‘IMBA’,’IMBA’);

form1.drpCourse.options[9] =new Option(‘M.Tech’,’M.Tech’);

form1.drpCourse.options[10] =new Option(‘MSW’,’MSW’);

break;

case 5:

form1.drpCourse.options[0] =new Option(‘B.A’,’B.A’);

form1.drpCourse.options[1] =new Option(‘B.COM’,’B.COM’);

form1.drpCourse.options[2] =new Option(‘B.Lis’,’B.Lis’);

form1.drpCourse.options[3] =new Option(‘B.Sc’,’B.Sc’);

form1.drpCourse.options[4] =new Option(‘BBM’,’BBM’);

form1.drpCourse.options[5] =new Option(‘EMBA’,’EMBA’);

form1.drpCourse.options[6] =new Option(‘M.A’,’M.A’);

form1.drpCourse.options[7] =new Option(‘M.COM’,’M.COM’);

form1.drpCourse.options[8] =new Option(‘M.Lis’,’M.Lis’);

form1.drpCourse.options[9] =new Option(‘M.Sc’,’M.Sc’);

form1.drpCourse.options[10] =new Option(‘MBA’,’MBA’);

form1.drpCourse.options[11] =new Option(‘P.G.Diploma’,’P.G.Diploma’);

break;

case 6:

form1.drpCourse.options[0] =new Option(’10th’,’10th’);

form1.drpCourse.options[1] =new Option(’12th’,’12th’);

break;

case 7:

form1.drpCourse.options[0] =new Option(‘PUC’,’PUC’);

break;

case 8:

form1.drpCourse.options[0] =new Option(‘B.A’,’B.A’);

form1.drpCourse.options[1] =new Option(‘B.COM’,’B.COM’);

form1.drpCourse.options[2] =new Option(‘B.Sc’,’B.Sc’);

form1.drpCourse.options[3] =new Option(‘BBA’,’BBA’);

form1.drpCourse.options[4] =new Option(‘BCA’,’BCA’);

form1.drpCourse.options[5] =new Option(‘M.A’,’M.A’);

form1.drpCourse.options[6] =new Option(‘M.COM’,’M.COM’);

form1.drpCourse.options[7] =new Option(‘M.Lis’,’M.Lis’);

form1.drpCourse.options[8] =new Option(‘M.Sc’,’M.Sc’);

form1.drpCourse.options[9] =new Option(‘MBA’,’MBA’);

}
}

</script>

</head>

<body>

<form name=”form1″ method=”post” action=”UserRegistration.aspx” id=”form1″>
<div>
<input type=”hidden” name=”__VIEWSTATE” id=”__VIEWSTATE” value=”/wEPDwUKMTgwMjczMDQ4OWQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgIFBnJkTWFsZQUIcmRGZU1hbGWTn+dr7qAuvZuVPzbDmT/g1sPyOQ==”>
</div>

<div>

<input type=”hidden” name=”__EVENTVALIDATION” id=”__EVENTVALIDATION” value=”/wEWDgLXjPylBAKw1fK2CgLj2PK2CgLC2PK2CgKFwsiVBwKQibuWDQKTjmcC4IqOtQEC95bQkAoCsZDqywwCnLSzkw8Css3Ggw1mZkjgQ5qe6HIsUeO4tjKNKKulEDrN”>
</div>
<fieldset>
<table width=”990″ border=”0″ cellpadding=”3″ cellspacing=”3″>
<tbody><tr>
<td width=”163″><label for=”name”>Name of the Candidate*</label></td>
<td width=”806″>
<input name=”FName” type=”text” id=”FName” class=”text_input1″ size=”20″ value=”First Name”>
<input name=”MName” type=”text” id=”MName” class=”text_input1″ size=”20″ value=”Middle Name”>
<input name=”LName” type=”text” id=”LName” class=”text_input1″ size=”20″ value=”Last Name”></td>
</tr>
<tr>
<td><label for=”email”>Contact No</label></td>
<td>
<input name=”Mobile” type=”text” id=”Mobile” class=”text_input1″ size=”20″ value=”Mobile”>
<input name=”Phone” type=”text” id=”Phone” class=”text_input1″ size=”20″ value=”Phone”> </td>
</tr>
<tr>
<td><label for=”name”>Date of Birth</label></td>
<td>
<select name=”drpMonth” id=”drpMonth” class=”text_input1″ style=”width:165px;”>
<option selected=”selected” value=”00″>Select Month</option>
<option value=”01″>January</option>
<option value=”02″>February</option>
<option value=”03″>March</option>
<option value=”04″>April</option>
<option value=”05″>May</option>
<option value=”06″>June</option>
<option value=”07″>July</option>
<option value=”08″>August</option>
<option value=”09″>September</option>
<option value=”10″>October</option>
<option value=”11″>November</option>
<option value=”12″>December</option>
</select>

<select name=”drpDate” id=”drpDate” class=”text_input1″ style=”width:165px;”>
<option selected=”selected” value=”00″>Date</option>
<option value=”01″>01</option>
<option value=”02″>02</option>
<option value=”03″>03</option>
<option value=”04″>04</option>
<option value=”05″>05</option>
<option value=”06″>06</option>
<option value=”07″>07</option>
<option value=”08″>08</option>
<option value=”09″>09</option>
<option value=”10″>10</option>
<option value=”11″>11</option>
<option value=”12″>12</option>
<option value=”01″>13</option>
<option value=”02″>14</option>
<option value=”03″>15</option>
<option value=”04″>16</option>
<option value=”05″>17</option>
<option value=”06″>18</option>
<option value=”07″>19</option>
<option value=”08″>20</option>
<option value=”09″>21</option>
<option value=”10″>22</option>
<option value=”11″>23</option>
<option value=”12″>24</option>
<option value=”06″>25</option>
<option value=”07″>26</option>
<option value=”08″>27</option>
<option value=”09″>28</option>
<option value=”10″>29</option>
<option value=”11″>30</option>
<option value=”12″>31</option>
</select>

<select name=”drpYear” id=”drpYear” class=”text_input1″ style=”width:165px;”>
<option selected=”selected” value=”Year”>Year</option>
<option value=”2000″>2000</option>
<option value=”1999″>1999</option>
<option value=”1998″>1998</option>
<option value=”1997″>1997</option>
<option value=”1996″>1996</option>
<option value=”1995″>1995</option>
<option value=”1994″>1994</option>
<option value=”1993″>1993</option>
<option value=”1992″>1992</option>
<option value=”1991″>1991</option>
<option value=”1990″>1990</option>
<option value=”1989″>1989</option>
<option value=”1988″>1988</option>
<option value=”1987″>1987</option>
<option value=”1986″>1986</option>
<option value=”1985″>1985</option>
<option value=”1984″>1984</option>
<option value=”1983″>1983</option>
<option value=”1982″>1982</option>
<option value=”1981″>1981</option>
<option value=”1980″>1980</option>
</select> </td>
</tr>
<tr>
<td><label for=”email”>University / Board</label></td>
<td>
<select name=”drpUniversity” id=”drpUniversity” class=”text_input1″ onchange=”fill_drpCourse(form1.drpUniversity.selectedIndex);” style=”width:165px;”>
<option selected=”selected” value=”Select University”>Select University</option>
<option value=”Allagappa”>Allagappa Univercity</option>
<option value=”Bangalore”>Bangalore University</option>
<option value=”KSEEB”>KSEEB</option>
<option value=”KSOU”>KSOU</option>
<option value=”Kuvempu”>Kuvempu Univercity</option>
<option value=”NIOS”>NIOS</option>
<option value=”Pre”>Pre University</option>
<option value=”TNOU”>TNOU Univercity</option>
</select></td>
</tr>
<tr>
<td><label for=”course”>Course</label></td>
<td>
<select name=”drpCourse” id=”drpCourse” class=”text_input1″ style=”width:165px;”>
</select>
</td>
</tr>

<tr>
<td><label for=”email”>Email Id</label></td>
<td>
<input name=”email” type=”text” id=”email” class=”text_input is_email” size=”20″></td>
</tr>

<tr>
<td><label for=”email”>Gender</label></td>
<td><label>
<input value=”radiobutton” name=”radiobutton” type=”radio” id=”rdMale”>
Male&nbsp;&nbsp;&nbsp;
<input value=”radiobutton” name=”radiobutton” type=”radio” id=”rdFeMale”>
Female</label></td>
</tr>

<tr>
<td>&nbsp;</td>
<td><input type=”hidden” id=”myemail” name=”myemail” value=”info@sparkgroupoftrust.com”>
<input type=”hidden” id=”myblogname” name=”myblogname” value=”Spark Group of Trust”>
<input type=”submit” value=”I Accept, Register Me”>

<input name=”Reset” type=”reset” value=”Reset” class=”button” id=”reset” size=”16″> </td>
</tr>
<tr>
<td>&nbsp;</td>
<td><span id=”lblMessage”></span></td>
</tr>
</tbody></table>
</fieldset>
</form>
</body>

</html>