473,320 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Odd occurence with extra variables in GET form

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
3 1927
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tesla | last post by:
Hey guys, I have a string like "lalala: djkahsd : dajkdassd : adasd :" Is there a function to find the position of the "I"th occurence of a character/string? Like lets say I want to find out...
1
by: Roland | last post by:
hi all having designed my schema to use repeating groups of elements, I found that some applications (eg. Microsoft InfoPath) refused to recognised that element as a repeating element. I...
0
by: Armin Wagenknecht | last post by:
Hello, i am modelling a TopicMap, and I have the following problem: I want to use two scopes in the topicmap for one occurence which has to satsify BOTH scopes!! Example: I have the...
3
by: Jessica Loriena | last post by:
I'm trying to write a simple "register form / validate and store in database / show welcome screen" application with ASP.Net. With conventional ASP, I used Session variables and it went something...
3
by: das | last post by:
Hi all, How can I get a row that has only one occurence in a table? Not through 'distinct' because this gets a single row that might have multiple occurences, I want to get only rows that have...
3
by: utab | last post by:
Dear all, I tried to solve the occurence problem: to find the distinct occurences of a word in an input. I know that I could use map and other STD lib functions. I tried to do it the hard way. I...
2
by: gauravguleria | last post by:
wht's the program which takes two strings using command line arguments and finds the occurence of second string in the first string.The program should return the starting position of first...
6
by: Kid Programmer | last post by:
This is pretty stupid. You can create the same program one using this much code:/* * blah.java * * Created on May 26, 2008, 9:35 AM */ package blah; /** *
1
by: mustafalp | last post by:
i want to write it with following prototype: int occurence (int a,intasize,int e) this function must returns the number of occurence of e in the array a in c++.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.