Page 1 of 1

HELP: odd "GET" querystring behaviour!

Posted: Sun Jan 13, 2008 11:24 am
by kennaasoft
I encountered a disturbing situation while coding a javascript-submitted form; i submit a form (using javascript: form.submit()) with the "GET" method, with the action set to something like:

Code: Select all

add_to_cart.php?prodid=16&qty=6
but i end up with

Code: Select all

add_to_cart.php?qty=6
after submitting, which breaks my script (with the first value cut off).
I must confess, I'm quite lost as to why this should happen.
Another odd thing is, if i set these values as hidden fields and submit the form using the "POST" method, everything works fine! Unfortunately, i can't use POST, since some of my javascript/AJAX functions depend on the query string.

If there is anyone out there who can help, i'd really appreciate it. :?:

Re: HELP: odd "GET" querystring behaviour!

Posted: Sun Jan 13, 2008 2:00 pm
by jimthunderbird
I think it might be something missing on your form submit. Also, did you check if you set the form action correctly in your javascript? If possible I would want to see the code snippet in order to determine the problem.

Re: HELP: odd "GET" querystring behaviour!

Posted: Sun Jan 13, 2008 2:07 pm
by Jonah Bron
I think we need to see the source to diagnose you problem. :D