Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old August 13th, 2008, 10:18 AM
Tarantulus's Avatar
Member
 
Join Date: May 2007
Posts: 90
Default button to NOT submit form

hi guys,

I have a form with a bunch of text fields and an [HTML]<input type="submit">[/HTML] , what I want is a button to CANCEL the submission of the form.

I tried [HTML]<a href="mypage"><input type=button></input></a>[/HTML]

which works in FF but not IE.

any ideas?
Reply
  #2  
Old August 13th, 2008, 12:00 PM
Newbie
 
Join Date: Aug 2008
Age: 21
Posts: 13
Default

hi,
i think you want to reset the from. if i am write then used this way <input type="reset" />
Reply
  #3  
Old August 13th, 2008, 01:10 PM
Tarantulus's Avatar
Member
 
Join Date: May 2007
Posts: 90
Default

I don't need to rest the form as such, I need to redirect to the homepage, to get out of the form completely.
Reply
  #4  
Old August 14th, 2008, 10:33 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 12,722
Default

Then you'll need JavaScript, or you could make the Cancel button part of another form and set its action to the home page (if you want to avoid using JavaScript).
Reply
  #5  
Old August 14th, 2008, 11:36 AM
Tarantulus's Avatar
Member
 
Join Date: May 2007
Posts: 90
Default

Doh, didn't think of making a second form (though I understand it's generally bad practice to do such a thing right?).

must avoid JS as the users of this site are usually older people who disable javascript for fear of breaking the internets!

thanks :)
Reply
  #6  
Old August 14th, 2008, 12:36 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 12,722
Default

I don't know if it's bad practice or not (seems so though), but I would avoid it if I could. Another alternative is just to use an image link (that'd make more sense).
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles