|
-
Sep 2nd, 2004, 09:14 AM
#1
Thread Starter
Lively Member
undefined
Code:
<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' ?
-
Sep 2nd, 2004, 09:23 AM
#2
Frenzied Member
Code:
onclick="javascript:alert(algin.value)"
edit: there's not supposed to be a space betweern java and script, vbforums does this
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Sep 2nd, 2004, 09:32 AM
#3
Thread Starter
Lively Member
-
Sep 2nd, 2004, 09:34 AM
#4
Frenzied Member
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:
Code:
<input type="radio" value="Right" name="algin" id="myID">
<input type="Button" onclick="alert(document.getElementById('myID').value)" value="Submit" name="B1" size="20">
Have I helped you? Please Rate my posts. 
-
Sep 2nd, 2004, 09:40 AM
#5
Thread Starter
Lively Member
It's Always Show "Left"
Code:
<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">
-
Sep 2nd, 2004, 09:43 AM
#6
Frenzied Member
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.
Have I helped you? Please Rate my posts. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|