passing submit id via form.submit()

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

passing submit id via form.submit()

Post by kendall »

I have been searching through the forums for an answer but i dont think i was using the right terms so i figured i'd post this up...

i have a form with to image button used as submit buttons.
both have different values that are relevant for the execution of PHP code
However both have a javascript confirm prompt that when success executes the form to submit
However i note that while Firefox is able to POST the submit value of the clicked submit button regardless that is is submitted via the form.submit() command...
With IE the submit value is not passed as a POST

What gives here...?
Are there any workarounds u recommend?

Kendall
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

IE is stingy with javascript variable names. If your using a

Code: Select all

<div id="blah">blah</div>
in your page, and then try to use blah as a javascript variable name, things might get wacky. Look out for that.

Besides that, without seeing your code, it's hard to say.
User avatar
phppage
Forum Contributor
Posts: 126
Joined: Mon Apr 24, 2006 1:47 pm
Location: West Yorkshire, UK

Post by phppage »

I had this problem as well. The way I got round this is to set a hidden input field and change the value using onclick js events depending on which submit button was click.
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

[SOLVED]

Post by kendall »

phppage wrote:I had this problem as well. The way I got round this is to set a hidden input field and change the value using onclick js events depending on which submit button was click.
Yeah thats what i ended up doing...apparantly the "IMAGE" input element reutrn only the mouse x and y cord in IE...stupid @#%

Kendall
User avatar
phppage
Forum Contributor
Posts: 126
Joined: Mon Apr 24, 2006 1:47 pm
Location: West Yorkshire, UK

Re: [SOLVED]

Post by phppage »

kendall wrote: Yeah thats what i ended up doing...apparantly the "IMAGE" input element reutrn only the mouse x and y cord in IE...stupid @#%
Kendall
Yep, IE can really get you down.
Post Reply