8 Replies - 1943 Views - Last Post: 28 June 2002 - 04:14 PM

#1 The Neoracle  Icon User is offline

  • Check, check, 1, 2.
  • member icon

Reputation: 21
  • View blog
  • Posts: 4,097
  • Joined: 30-March 01

Submit Values Don't Work In Ie. . .

Posted 28 June 2002 - 11:27 AM

Alright, i've got a form in a PHP page that uses 2 images as submit buttons. Each one has a Value="Foo" and that sets a varible ButtonName=Foo, I use that to tell php which page to go to on submit of the form.

Well, this is not working in IE (but it does in Netscape and Mozilla on both PC and Mac).

Anyone have any ideas how I can set a varible "on submit" of a form in html that will work crossbrowser?
Is This A Good Question/Topic? 0
  • +

Replies To: Submit Values Don't Work In Ie. . .

#2


Reputation: 0

Re: Submit Values Don't Work In Ie. . .

Posted 28 June 2002 - 01:17 PM

I know how to do this I think, but you need to be clearer. What does your code look like? What exactly are you trying to do? Are you trying to make the form submit to different places based upon which button is hit?


<input type="button" name="Button" value="Foo" onclick="document.location='Somepage.asp?var=something&var2=somethingelse'"



This can be used for php as well.

H
Was This Post Helpful? 0

#3 The Neoracle  Icon User is offline

  • Check, check, 1, 2.
  • member icon

Reputation: 21
  • View blog
  • Posts: 4,097
  • Joined: 30-March 01

Re: Submit Values Don't Work In Ie. . .

Posted 28 June 2002 - 01:25 PM

hoopster, on Jun 28 2002, 05:17 PM, said:

I know how to do this I think, but you need to be clearer.  What does your code look like?  What exactly are you trying to do?  Are you trying to make the form submit to different places based upon which button is hit?


<input type="button" name="Button" value="Foo" onclick="document.location='Somepage.asp?var=something&var2=somethingelse'"



This can be used for php as well.

H

Ok, I have this:
"<form name="orderform" method="post" action="https://secure.4dvision.net/dreamcases/order.php">"

and my button is:
"<INPUT TYPE="image" SRC="images/images/total.gif" VALUE="retotal" NAME="act" ALT="Recalculate Total" >

and on order.php I have
if(act=foo){
blah blahz}
etc.
Was This Post Helpful? 0
  • +
  • -

#4


Reputation: 0

Re: Submit Values Don't Work In Ie. . .

Posted 28 June 2002 - 01:49 PM

OK, the totally ugly solution is to use a radio button just before the submit button to set foo.

Another solution is to pass foo in the URL. But the button can't be used to set the value as far as I know. We have had this same issue a couple times where we wanted a submit to also do something else like open an new window or use an event handler, but for some reason it didn't fly.

How many form fields? You could pass all the values in the URl if it's not too many and instead of submiting the form just use the code I showed you earlier.

H
Was This Post Helpful? 0

#5 The Neoracle  Icon User is offline

  • Check, check, 1, 2.
  • member icon

Reputation: 21
  • View blog
  • Posts: 4,097
  • Joined: 30-March 01

Re: Submit Values Don't Work In Ie. . .

Posted 28 June 2002 - 01:53 PM

Ok, here's the thing though, my method works in Mozilla.
It's just not flying in IE.

Can you explain more how to do your original method?
I can't do the URL cause both forms are BIG and have CC Numbers in them.
Was This Post Helpful? 0
  • +
  • -

#6


Reputation: 0

Re: Submit Values Don't Work In Ie. . .

Posted 28 June 2002 - 01:58 PM

What are you trying to do? Submit to different pages? Different pages is hard unless you already captured which page before you load this form. Do you have a link I can look at?

I reccomend you split your long form in half and determine where they are going on the first half and then put different form actions in an if or switch statement based upon the variable from the first half.

H
Was This Post Helpful? 0

#7


Reputation: 0

Re: Submit Values Don't Work In Ie. . .

Posted 28 June 2002 - 01:58 PM

The Neoracle, on Jun 28 2002, 02:53 PM, said:

Ok, here's the thing though, my method works in Mozilla.
It's just not flying in IE.

Can you explain more how to do your original method?
I can't do the URL cause both forms are BIG and have CC Numbers in them.

works in mozilla is akin to saying it works in china on thursdays... if it doesn't work in IE it's pretty broken... ;)

H
Was This Post Helpful? 0

#8 The Neoracle  Icon User is offline

  • Check, check, 1, 2.
  • member icon

Reputation: 21
  • View blog
  • Posts: 4,097
  • Joined: 30-March 01

Re: Submit Values Don't Work In Ie. . .

Posted 28 June 2002 - 02:02 PM

LOL, yeah, cause it working in the standards compliant browser, it's broken. ;)


Anyway, I have the orderform.php. This submits to order.php which, depending on what $act='s includes the appropriate page (retotal, checkout, submit, or reciept). In these pages, I have the different buttons to retotal your order or check out, then to reset the form or resubmit the order, etc.
Was This Post Helpful? 0
  • +
  • -

#9


Reputation: 0

Re: Submit Values Don't Work In Ie. . .

Posted 28 June 2002 - 04:14 PM

Are we talking about netscape or Mozilla as the standards compliant browser? Both netscape and IE are guilty of bending the rules to increase the funcionality of their browser. Neither of them is 100% in line with the standards and discussing mozilla is like talking about every 7th rainy wednesday in ethiopia.

For the problem you have I would suggest carrying all the values you need as hidden values in one form for the checkout and displaying the values in text boxes for the update form. I would also submit to PHP_SELF or ?.

You could also access the values of one form from another by naming the form and getting to it in javascript on the DOM but this would get a little complex.

H
Was This Post Helpful? 0

Page 1 of 1