By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,724 Members | 1,655 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,724 IT Pros & Developers. It's quick & easy.

Odd occurence with extra variables in GET form

P: n/a
I have the following HTML form:
<form method="GET" action="modules.php">
<input type="hidden" name="name" value="Catalog">
<input type="hidden" name="task" value="addcart">
<input type="hidden" name="item" value="1">

<P>Available option: thing b - $44.90
<input type="checkbox" name="y0" value="6"></P>
<P>Available option: thingc - $-3.00
<input type="checkbox" name="y1" value="7"></P>
<P>Available option: thingd - $2.80
<input type="checkbox" name="y2" value="8"></P>

<input type="hidden" name="cnt" value="3">
<center>
<input type="image" src="cart.png" value="Submit">
</center>
</form>

When I submit the form, lets say I check off the first and the third
checkboxes, I get the following querystring:

?name=Catalog&task=addcart&item=1&y0=6&y2=8&cnt=3& x=48&y=4

Where in the world are x=48 and y=4 coming from?

They seem to be coming from the position I click on the submit image? Is
this right? Can someone point me to a page talking about this, I can't
google anything?
--
[ Sugapablo ]
[ http://www.sugapablo.com <--music ]
[ http://www.sugapablo.net <--personal ]
[ su*******@12jabber.com <--jabber IM ]

Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Sugapablo <ru**@REMOVEsugapablo.com> writes:
<input type="image" src="cart.png" value="Submit">

checkboxes, I get the following querystring:

?name=Catalog&task=addcart&item=1&y0=6&y2=8&cnt=3& x=48&y=4

Where in the world are x=48 and y=4 coming from?

They seem to be coming from the position I click on the submit image? Is
this right? Can someone point me to a page talking about this, I can't
google anything?


That's correct, yes.
http://www.htmlhelp.com/reference/ht...rms/input.html - about 2/3
of the way down.

Incidentally, wouldn't value="Add to Cart" be friendlier than
value="Submit"?

--
Chris
Jul 20 '05 #2

P: n/a
Sugapablo wrote:
I have the following HTML form:
<form method="GET" action="modules.php">
Order forms are not normally idempotent. method="POST" is likely more
appropriate.
<input type="hidden" name="name" value="Catalog">
<input type="hidden" name="task" value="addcart">
<input type="hidden" name="item" value="1">

<P>Available option: thing b - $44.90
<input type="checkbox" name="y0" value="6"></P>
Since this is not a paragraph, <P> markup is inappropriate. How about
this?

<div><label>Available option</label><input ...></div>
<input type="image" src="cart.png" value="Submit">

When I submit the form, lets say I check off the first and the
third checkboxes, I get the following querystring:

?name=Catalog&task=addcart&item=1&y0=6&y2=8&cnt=3& x=48&y=4

Where in the world are x=48 and y=4 coming from?

They seem to be coming from the position I click on the submit
image?
Of course. That's pretty much as the HTML spec requires.
Is this right? Can someone point me to a page talking about this,
I can't google anything?


Why? Is Google not responding? I'd start at the w3c's HTML recommedation:

http://www.w3.org/TR/html4/

Particularly, the section on forms:

http://www.w3.org/TR/html4/interact/forms.html

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 20 '05 #3

P: n/a
Brian wrote:
<div><label>Available option</label><input ...></div>


Typed that way too fast. That would not be very useful. This is better:

<div>
<label for="y0">Available option</label>
<input name="y0" id="y0" type="checkbox" value="6">
</div>

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.