html - Javascript code is not working -
How can I modify the code so that when I first select an option from the drop down menu, edit the second drop down menu Eligible, otherwise the second drop-down menu should be read only, and if the option is "default" in the first drop down menu then the second drop down menu should be read-only.
& lt;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Script type = "text / javascript" & gt; Function mySecondFunction () {document.getElementById ("mySelection"). Disabled = false; } & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Form action = "" & gt; & Lt; Select name = "car" onload = "mySecondFunction ()" & gt; & Lt; Option value = "default" & gt; Default & lt; / Options & gt; & Lt; Option value = "saab" & gt; Saab & lt; / Options & gt; & Lt; Option value = "fayat" & gt; Fiat & lt; / Option & gt; & Lt; Option value = "Audi" & gt; Audi & lt; / Options & gt; & Lt; / Select & gt; & Lt; Br> & Lt; Choose disabled name = "car" id = "myselection" & gt; & Lt; Option value = "Action 1" & gt; Volvo & lt; / Option & gt; & Lt; Option value = "action 2" & gt; Saab & lt; / Options & gt; & Lt; Option value = "Action 3" & gt; Fiat & lt; / Option & gt; & Lt; Option value = "Action 4" & gt; Audi & lt; / Options & gt; & Lt; / Select & gt; & Lt; / Form & gt; & Lt; / Body & gt; & Lt; / Html & gt;
Look at capitals:
GetElementById ("MySelection"). Disabled = false; & Lt; Choose disabled name = "car" id = "myselection" & gt; The first is secured with "M" and "M"
Comments
Post a Comment