views:

82

answers:

1

First time using Asp.net-mvc and originally followed the NerdDinner tutorial. My form submit button looks like this: <p> <input type="submit" value="Save" /> </p>

I've now added another button to the page with jQuery code attached. It works in IE, but when I test in FireFox the form submits. I tried adding another button, this time with no attached jQuery code and the same thing happens. When the button is clicked, the form submits.

<button id="random-button">Do Nothing</button>

??

+4  A: 

I recall that Firefox defaults a <button> to a submit button. If you use

 <button type="button" id="random-button">Do Nothing</button>

it should solve your problems.

seth
Thank you. That seems to have broken my jQuery, but it has solved the submit problem. I'll have to fix my jQuery now.
RememberME
You are welcome. It's one of those things that you remember for the rest of your life the first time you run into it. Have fun collecting these tidbits.
seth
... and a baffling problem on my own page is suddenly explained. Thank you much. God, I love this site.
BlairHippo