Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Html - insert button into a form that does NOT act as submit

Author
Message
Rudolpho
19
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 28th Feb 2009 12:39
Hm, sorry for the annoyingly long title...

Anyways, I'm writing a small interactive webpage of sorts and was just about to add BBCode insertion tags to my textareas.
That works well, except for one thing - every single button I insert within the form will post the data when clicked. I do not want that, and actually I thought you needed to specify <input type = "submit" ...> for these things.
I've googled for it, but managed to find nothing of relevance. Still, this should probably be pretty standard knowledge, so if anybody feels like sharing, I'm all ears

Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 28th Feb 2009 12:51
Research the <button> tag

or

<input type="button">

Rudolpho
19
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 28th Feb 2009 17:08
Yes, I was using <button>.
It turned out that it sets its type to 'submit' by default though (which I didn't know), so omitting the type = "" part made it a submit button.
So adding type = "button" fixed that.

Thanks for your time.

Login to post a reply

Server time is: 2025-06-07 15:54:45
Your offset time is: 2025-06-07 15:54:45