My <Button>'s keep submitting as a form and they don't run the onclick="Blah()". Should I not use the <Button>'s? Got a good site recomendation with v e r y s i m p l e examples?
Many Thanks! M
coopster
6:22 pm on Sep 1, 2006 (gmt 0)
Make sure it is of type [w3.org] "button" instead of "submit".
HeadBut
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
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.
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
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
6:56 pm on Sep 2, 2006 (gmt 0)
you just need to put: return false; at the end of the onclick. Example: