![](http://content.invisioncic.com/r49260/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
boggen
-
Posts
3 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by boggen
-
-
() {} [] no go. :/ thanks for trying. any other suggestions?
-
i thought i could access the select element by simply implying getelementbyid. but when i try i get...(( error:'document.getElementByID.b1' is null or not an object ))ay i can use (( forms["x"].elements["x"].what_i_want )) but boy do i not want to re type up a few pages to work in a forms name into the equations and variables.
<html><head><script language="JavaScript" type="text/javascript">function clear_menu(){alert(document.getElementByID["b1"].selectedIndex);}function clear_menu2(){alert(document.forms["chap1"].elements["b1"].selectedIndex);}</script></head><body><form name="chap1"> <p> <input name="Button" type="button" onClick="clear_menu();" value="getelementbyid does not work"> (( error:'document.getElementByID.b1' is null or not an object )) </p> <p> <input name="Button" type="button" onClick="clear_menu2();" value="forms.elements works"> </p> <p> <select name="b1" id="b1"> <option value="123">456</option> <option value="234">567</option> <option value="345">678</option> </select> </p></form></body></html>
getelementbyid and select menu problems
in JavaScript
Posted