coopster

msg:3069088 | 6:22 pm on Sep 1, 2006 (gmt 0) |
Make sure it is of type [w3.org] "button" instead of "submit".
|
HeadBut

msg:3069111 | 6:37 pm on Sep 1, 2006 (gmt 0) |
Wow, that works but seems a little redundant <Button Type="button" id="button" Name="Button" Value="Button">Button</button> So, now how do I access the "...>Button</b..." value/content/what? Thanks Tons and "Damn Your Fast!" M
|
coopster

msg:3070038 | 6:05 pm on Sep 2, 2006 (gmt 0) |
I didn't even realize it was the button [w3.org] element. The first link I gave was for the <input type="button"> element. Here nor there, you got your resolution. How do you attain the value? Pass it in your "onclick" attribute. <button type="button" value="My button value" onclick="alert(this.value)">Button</button>
|
HeadBut

msg:3070043 | 6:14 pm on Sep 2, 2006 (gmt 0) |
The: <form><Button>Buton</button></form>. still submit's the form when clicked. Is there a way to avoid that, I don't want to submit the form. (I'd like to do it through AJAX)
|
coopster

msg:3070048 | 6:17 pm on Sep 2, 2006 (gmt 0) |
The <button> element defaults to a type="submit" (see last link provided) unless you specify otherwise. Make sure you are setting the type="button" and it won't submit on you.
|
carguy84

msg:3070081 | 6:56 pm on Sep 2, 2006 (gmt 0) |
you just need to put: return false; at the end of the onclick. Example: <input type="submit" value="Whatever" onclick="someFunction(); return false;" />
|
|