lulu50
asked on
Dropdown list
Hi,
I have two dropdown list
The first one is this:
and the Second one is this:
What I want is when the user select the value "Retired" from AppLifeCycle list box,
it should automatically select the option "Yes" from the list box retired.
this is what I have so far that does not work.
I have two dropdown list
The first one is this:
<select name="AppLifeCycle" size="1" id="AppLifeCycle" onChange="return ChangeStatus();">
<option value="Core" selected>Core</option>
<option value="Declining" >Declining</option>
<option value="Emerging" >Emerging</option>
<option value="Niche" >Niche</option>
<option value="Phase-Out" >Phase-Out</option>
<option value="Planned" >Planned</option>
<option value="Retired" >Retired</option>
</select>
and the Second one is this:
<select name="retired" size="1" id="retired">
<option value="0" selected>No</option>
<option value="1" >Yes</option>
</select>
What I want is when the user select the value "Retired" from AppLifeCycle list box,
it should automatically select the option "Yes" from the list box retired.
this is what I have so far that does not work.
function ChangeStatus() {
var RetiredFld = $("#AppLifeCycle").val();
if ( RetiredFld == "Retired"){
$("#retired option").prop("selected",1)
}
else
{
$("#retired option").prop("selected",0)
}
return true;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Rikin,
It works!!!!!!
Great!!!!!!
Thank you for your help!!!!!!
It works!!!!!!
Great!!!!!!
Thank you for your help!!!!!!
ASKER
Thank you
Open in new window