Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-12-2010, 02:41 PM   PM User | #1
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,587
Thanks: 5
Thanked 864 Times in 841 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
prevent submit button from submitting and execute onclick action instead

Would any of you kind people please visit http://www.primacom.net/~k6531190/ml/adminCodeEdit.html, click on “add media” and then click “cancel” using Internet Explorer or Opera and compare it to Firefox or Safari, please?

The general issue is that I have several submit buttons that perform different tasks and I want to add dynamic functionality so that clicking a certain submit button won’t submit the form right away but execute an onclick action instead. I haven’t managed to get that working without wrapping another element around the button(s) and executing the onclick action on these elements instead. And then, more specifically, in the overlay the click of the cancel button does close it alright in Firefox and Safari but it still submits the form in IE and Opera. What do I have to do to prevent this from happening? Will I have to replace the inputs completely?

The respective JavaScript can be found in http://www.primacom.net/~k6531190/ml/js/functions.js starting in the second half of the document.
__________________
Don’t click this link!

Last edited by VIPStephan; 03-12-2010 at 06:34 PM..
VIPStephan is offline   Reply With Quote
Old 03-12-2010, 06:33 PM   PM User | #2
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,587
Thanks: 5
Thanked 864 Times in 841 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
Ah well, I ended up replacing the <input type="submit"> with an <input type="button"> which does nothing by default and allowed to add an onclick event without problems.

Sometimes things can be so simple.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Reply

Bookmarks

Tags
input, javascript overlay, onclick, submit button

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:12 PM.


Advertisement
Log in to turn off these ads.