Click here to get back home

Form post

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Form post zoomcart.com 04-18-2008
---> Re: Form post Jonathan N. Lit...04-18-2008
| ---> Re: Form post Steven Saunders...04-18-2008
|   ---> Re: Form post Steven Saunders...04-18-2008
|     `--> Re: Form post Jukka K. Korpel...04-19-2008
`--> Re: Form post Beauregard T. S...04-18-2008
Posted by zoomcart.com on April 18, 2008, 7:16 pm
Please log in for more thread options
Hello and thanks in advance for your help.
I have code below that posts form data to a cgi scripted shopping cart
and it works great on my mac/firefox browser, but it doesn't work on
ibm/netscape machines. what gives? apparently the data isn't being
recognized and so the cart defaults to it's home page.
<form name='submit3' action='http://my.com/cart.cgi' method='post'>
<input type='hidden' name='user' value='bighouse'>
<input type='hidden' name='item_name' value='My Product'>
<input type='hidden' name='item_number' value='001'>
<input type='hidden' name='item_price' value='3.95'>
<input type='hidden' name='item_weight' value='0'>
<input type='hidden' name='NOTAX' value=''>
<input type='hidden' name='DOWNLOAD' value='1001.zip'>
<input type='image' src='advertisement.gif' value='Buy and Download
Now' name='add_to_cart'>
</form>

Posted by Jonathan N. Little on April 18, 2008, 8:43 pm
Please log in for more thread options
zoomcart.com wrote:
> Hello and thanks in advance for your help.
> I have code below that posts form data to a cgi scripted shopping cart
> and it works great on my mac/firefox browser, but it doesn't work on
> ibm/netscape machines. what gives? apparently the data isn't being
> recognized and so the cart defaults to it's home page.
> <form name='submit3' action='http://my.com/cart.cgi' method='post'>
> <input type='hidden' name='user' value='bighouse'>
> <input type='hidden' name='item_name' value='My Product'>
> <input type='hidden' name='item_number' value='001'>
> <input type='hidden' name='item_price' value='3.95'>
> <input type='hidden' name='item_weight' value='0'>
> <input type='hidden' name='NOTAX' value=''>
> <input type='hidden' name='DOWNLOAD' value='1001.zip'>
> <input type='image' src='advertisement.gif' value='Buy and Download
> Now' name='add_to_cart'>
> </form>

And the submit but is where? Which version Netscape, since currently RIP...

Also URL far better than your snippet, most likely the problem is in
something you have left out.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Posted by Steven Saunderson on April 18, 2008, 9:27 pm
Please log in for more thread options
On Fri, 18 Apr 2008 20:43:26 -0400, "Jonathan N. Little"

> zoomcart.com wrote:
> > <form name='submit3' action='http://my.com/cart.cgi' method='post'>
> > <input type='image' src='advertisement.gif' value='Buy and Download
> > Now' name='add_to_cart'>
> > </form>
>
> And the submit but is where? Which version Netscape, since currently RIP...

I thought 'image' functioned as a submit button. Perhaps it isn't
widely supported.
--
Steven

Posted by Steven Saunderson on April 18, 2008, 10:13 pm
Please log in for more thread options
wrote:

> On Fri, 18 Apr 2008 20:43:26 -0400, "Jonathan N. Little"
>
> > zoomcart.com wrote:
> > > <form name='submit3' action='http://my.com/cart.cgi' method='post'>
> > > <input type='image' src='advertisement.gif' value='Buy and Download
> > > Now' name='add_to_cart'>
> > > </form>
> >
> > And the submit but is where? Which version Netscape, since currently RIP...
>
> I thought 'image' functioned as a submit button. Perhaps it isn't
> widely supported.

I've just tested using Opera and for the 'image' above it would include
'&add_to_cart.x=0&add_to_cart.y=0' in the GET array (presumably the same
for POST). But there is no '&add_to_cart=whatever' and this makes it
different from a submit button.
--
Steven

Posted by Jukka K. Korpela on April 19, 2008, 12:45 am
Please log in for more thread options
Scripsit Steven Saunderson:

>>>> <form name='submit3' action='http://my.com/cart.cgi' method='post'>
>>>> <input type='image' src='advertisement.gif' value='Buy and Download
>>>> Now' name='add_to_cart'>
>>>> </form>
...
>> I thought 'image' functioned as a submit button. Perhaps it isn't
>> widely supported.

It's widely supported - widely inconsistently, with different quirks and
oddities. See
http://www.cs.tut.fi/~jkorpela/forms/imagebutton.html
which is very dusty but perhaps suitable in a context where someone
worries about Netscape.

> I've just tested using Opera and for the 'image' above it would
> include '&add_to_cart.x=0&add_to_cart.y=0' in the GET array
> (presumably the same for POST). But there is no
> '&add_to_cart=whatever' and this makes it different from a submit
> button.

That's the "classical" browser behavior. Newer implementations include
the name=value pair, too. The specifications are, as usual, fairly
obscure.

There's the simple solution
<input type="submit" value="Buy">
and this should at least be used in prototypes and debugging, to
distinguish all the problems caused by image submit buttons from other
problems.

Regarding the name=value pair from a submit button (normal or image),
don't count on it. Mostly, a single form should only contain one submit
button to avoid confusion or, in some cases, two or more _equivalent_
submit buttons. The choice between different actions should be made in
some other way, e.g. radio buttons.

The idea of having different buttons for different actions in the same
form, like "Buy" and "Get info", sounds nice, but it fails to work in
general, due to implementation faults. For example, what happens when
the user types text in a text input field and hits Enter, using a
browser where that causes form submission?

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/


Similar ThreadsPosted
IE form post oddness September 13, 2006, 4:14 pm
Form POST problem May 14, 2007, 2:49 am
Form POST problem May 15, 2007, 2:53 am
form post never submits - no errors of any kind September 28, 2004, 5:07 pm
HTML Form post to popup-window January 22, 2008, 10:41 pm
POST validation October 6, 2005, 2:45 pm
Post Meta World? September 2, 2005, 3:12 am
making use POST method? February 11, 2006, 7:37 am
Text-links using POST ? September 8, 2006, 1:17 pm
[Q] Using the POST Method with HTML Anchor Tags March 23, 2005, 2:52 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap