Sign in | Join
Last post 08-07-2007 11:42 PM by d4dennis@inspir3. 4 replies.
Sort Posts: Oldest to newest Newest to oldest
for example my items inside the dropdownlist is apple, banana, grapes
if i pick apple my textbox1 will be disabled
or i pick banana my textbox 2 will be disabled
so on so forth
In javascript please. thanks!
Does this help?
dropdown.Attributes.Add("onChange", "javascript:return Check('" & dropdown.ClientID.ToString() & "')")
<script type="text/javascript"> function TimeCheck(ctlname) { // Get the relevant control var ddl = document.getElementById(ctlname); var txt = ddl.options[ddl.selectedIndex].text switch (txt) { // Do your switch statements and disable the // relative textbox } }
Hi there,
Base on your requirement, i've written following block of code. Hope it helps!
txt2.disabled =
txt1.disabled =
txt3.disabled =
}
<
</
where is the line/ event where the control will be disabled?
Hi There,
Ez416: where is the line/ event where the control will be disabled?
If this asking me? If yes .
d4dennis@inspir3: if ( sender.value == "Apples" ) txt1.disabled = true;else if ( sender.value == "Bananas" ) txt2.disabled = true;else if ( sender.value == "Grapes" ) txt3.disabled = true; }
*** txt1 or txt2 or txt3 is an object reference. to use this you have to get the object using document.getElementById(..
Hope it helps!