On selection of radio button to change the value of drop down list
Thursday, August 2nd, 2007<!– To define a radio button –>
<input type=”radio” name=”proptype” value=”Residential” onclick=”javascript:residential()” checked=”checked”>Residential
<input type=”radio” name=”proptype” value=”Commercial” onclick=”javascript:commercial()” “>Commercial
<select name=”propertytype”size=”1″>
<option value=”ResApartment”>Residential Apartment</option></select>
<!– Script code–>
function residential()
{
var drop=document.form1.propertytype;
drop.options.length = 0
drop.options[drop.options.length] = new Option (”Residential Apartment”);
drop.options[drop.options.length] = new Option (”
}
function commercial()
{
var drop=document.form1.propertytype;
drop.options.length = 0
drop.options[drop.options.length] = new Option (”Commercial Shop”);
drop.options[drop.options.length] = new Option (”Commercial Office”);
}