Click to See Complete Forum and Search --> : undefined
the hater
Sep 2nd, 2004, 09:14 AM
<span lang="en-us"><font face="Tahoma" size="2"> </font></span><font face="Tahoma"><input type="radio" value="Left" name="algin" checked><span lang="en-us"><font size="2">Left</font></span></font></p>
<p>
<font face="Tahoma"><span lang="en-us"><font size="2"> </font></span><input type="radio" value="Right" name="algin"><span lang="en-us"><font size="2">
Right</font></span></font></p>
<p><input type="Button" onclick="alert(algin.value)" value="Submit" name="B1" size="20">
Whay The Alert Is 'undefined' ?
Jop
Sep 2nd, 2004, 09:23 AM
onclick="javascript:alert(algin.value)"
edit: there's not supposed to be a space betweern java and script, vbforums does this
the hater
Sep 2nd, 2004, 09:32 AM
No
Doesn't this ..
Acidic
Sep 2nd, 2004, 09:34 AM
also it's document.whatever.value
But even this moght not work depending on where in the DOM the element is located. give the element in id and the do document.getElementById(id).value
eg:
<input type="radio" value="Right" name="algin" id="myID">
<input type="Button" onclick="alert(document.getElementById('myID').value)" value="Submit" name="B1" size="20">
the hater
Sep 2nd, 2004, 09:40 AM
It's Always Show "Left"
<span lang="en-us"><font face="Tahoma" size="2"> </font></span><font face="Tahoma"><input type="radio" value="Left" name="algin" id="myID" checked><span lang="en-us"><font size="2">Left</font></span></font></p>
<p>
<font face="Tahoma"><span lang="en-us"><font size="2"> </font></span><input type="radio" value="Right " name="algin" ><span lang="en-us"><font size="2">
Right</font></span></font></p>
<p><input type="Button" onclick="alert(document.getElementById('myID').value)" value="Submit" name="B1" size="20">
Acidic
Sep 2nd, 2004, 09:43 AM
well, of course it will always show left. you've given the ID to the tag with value="Left". Note that no two elements can have the same ID attribute.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.