Hi,
Can you please help me, I want to write a dropdown box that have an option 'Other' but when the Other is selected my textbox need to be enable and take the textbox value as an output instead of Other.
[HTML]<script language=javascript type="text/javascript">
function pairSelectToOther(whichCtrl,otherCtrl,otherStr)
{
if(whichCtrl.options[whichCtrl.selectedIndex].value == otherStr)
{
otherCtrl.disabled = false;
alert("Please provide specification")
}
else
{
otherCtrl.disabled = true;
//if the guy selects some other value in the select box , after inputting into the
//other textbox, the value shouldn't get posted.
otherCtrl.value = "";
}
return true;
}
</script>
<select id="selectlist" name="role" style="font-family: Arial; width:200px;" onChange="return pairSelectToOther(this,Reason_Other,'Other')">
<option value="Lead Arrager">Lead Arrager</option>
<option value="Joint Lead Arrager">Joint Lead Arrager</option>
<option value="Dealer">Dealer</option>
<option value="Finacial Advisor">Finacial Advisor</option>
<option value="Joint Finacial Advisor">Joint Finacial Advisor</option>
<option value="Lender">Lender</option>
<option value="Lead Manager">Lead Manager</option>
<option value="Joint Manager">Joint Manager</option>
<option value="Underwriter">Underwriter</option>
<option value="Other">Other</option>
</select>
<% //Done Role Changes (Other ) %>
<br>
<br>
<b></b><i style="font-family: Arial; color: #00376c;"><font size="2">(if <b>'Other'</b>, please specify)</font></i></b>
<br>
<input style="font-family: Arial;" type="text" name="Reason_Other" disabled size="38">[/HTML]