Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#291126 - 04/12/2006 21:37 Help with HTML form in Opera and IE6
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
I put up an email form last month to stop spam from coming in to my mailbox from my web site. I posted about this a while back as I had a completely different issue.

The issue right now is that apparently my form doesn't work with Opera (any platform) or IE6 in Windows. Works fine from Safari and Firefox (that I know of) and Camino (which is also Mozilla based).

The form is here: http://twistedmelon.com/contact/contact.php

The form's action is to submit back to itself and then I can do some validation of the fields and if everything is OK I perform the emailing and then send the user to a thank you page. It's a POST method.

The submit button is of type image and carries the name "actn" and a value of "submit" - this is taken from a larger script I implemented for my shopping cart, but the "actn" is basically what should be posted. In the case of this button it's a "submit" which i then check teh value of to find out what should be done. This allows refreshing the page without trying to submit, etc.

In the shopping cart there are other possible values for "actn" which can do things like update the cart, delete items, etc.

Anyway, I think the problem at least with Opera is that the value attribute of the image button is being ignored. So the form submits back to itself but when I check "actn" its value is not submit so the form just re-displays instead of processing and doing its business.

My shopping cart has the same problem on the final "Order Now" button (feel free to try this - don't worry, no sales will go through unless the whole paypal part after that is also completed).

Can anyone offer some advice? I'm pretty stuck on this right now.
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#291127 - 04/12/2006 23:08 Re: Help with HTML form in Opera and IE6 [Re: hybrid8]
g_attrill
old hand

Registered: 14/04/2002
Posts: 1172
Loc: Hants, UK
I haven't come across this bug, but I have written forms in the manner you describe, using image inputs with values according to the action being taken. If I recall correctly, the names have the X and Y values of where the image was clicked, and you need to parse the field names to find the name of the field clicked.

I think the values are something like submit.x=3 and submit.y=12. If you can, change the script to iterate all the form values and see what is being sent, or change it to a GET request.

edit: I think this post has some detail which might be useful:
http://lists.evolt.org/archive/Week-of-Mon-20041108/166064.html

Gareth

Top
#291128 - 04/12/2006 23:57 Re: Help with HTML form in Opera and IE6 [Re: g_attrill]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
The problem is like I suspected, the 'value' attribute isn't being sent by IE nor Opera.

For the email form I simply put in a hidden input with the same name "actn" and the value "submit" - so when the form gets submitted, "actn" always has the value "submit"

For the shopping cart I can't do this as easily because when that gets submitted it has to support various values for all the functionality I have in there. I will have to try to put in a hidden input element on the fly at the time of the submit, if I can. Hmmm... Will have to go through the source carefully again.
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#291129 - 05/12/2006 03:49 Re: Help with HTML form in Opera and IE6 [Re: hybrid8]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Quote:
The problem is like I suspected, the 'value' attribute isn't being sent by IE nor Opera.

For the email form I simply put in a hidden input with the same name "actn" and the value "submit" - so when the form gets submitted, "actn" always has the value "submit"

For the shopping cart I can't do this as easily because when that gets submitted it has to support various values for all the functionality I have in there. I will have to try to put in a hidden input element on the fly at the time of the submit, if I can. Hmmm... Will have to go through the source carefully again.


I wonder if, instead of value "submit", the button could trigger some javascript to set/save the necessary data, and then do a submit action? Dunno. Total neophyte here.

Cheers

Top
#291130 - 05/12/2006 04:23 Re: Help with HTML form in Opera and IE6 [Re: mlord]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
I think I can solve it with a bit of javascript, but the current cart implementation works very well without javascript as well. I made sure of it in fact.

One of the submit instances is actually when changing the country or changing the province for Canada. That works by having the default action of the submission set to refreshing. That's why I need to set that value in the first place (to make it go beyond a refresh).

With javascript enabled, the refresh happens automatically when you alter the setting of the country pop-up menu. With no javascript a small update/apply button appears and you have to manually press that after you change country to cause it to update the form.

When the form updates, other attributes are set depending on which country is selected (address format, tax, shipping, etc.) All values already in the form are preserved because it was a form submitted back to itself.
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top