473,396 Members | 1,843 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,396 software developers and data experts.

Problem with POST Method

Dear all,

I have been facing a strange problem with IE.

I have a form as below:

<form id="form_subset_products" name="form_subset_products"
method="get" action="../cart/addbasket.asp" >
<input type="hidden" name="act" value="from_products_subsets_page"/>
<input type="submit" name="sendd" value="Confirm And Buy"/>
...
...
</form>
and a javascript function is supposed to submit it as below:

var action;
action = "../products/template6_cart_details.asp";
document.getElementById('form_subset_products').ac tion = action
document.getElementById('form_subset_products').su bmit();

This code works fine in Firefox as intended. IE strangely submits the
form with unintended variables.

Querystring from Firefox:
"act=from_products_subsets_page&product_id_1318=13 18&add_qty_1318=2&product_id_1319=1319&add_qty_131 9=3"
which is right

Querystring from IE (for same values as above):
"add_qty_1307=0&product_id_1307=1307&act=from_prod ucts_page"
which is wrong and should have "act=from_products_subsets_page" insted
of "act=from_products_page". Also all the other values are wong too in
IEs querystring.

Can some one please suggest me where I am going wrong please??

Many thanks in advance,

Chaitu..

Feb 21 '06 #1
5 1318
Chaitu,

How are you accessing the query string? Are you certain that you're
getting it directly from the form submission and not after some
additional processing that may be kicking in under certain
circumstances in your ASP code?

In a simple test with the code you provided--making the action point
back to the test page instead of your ASP script--I get identical
behavior for both Firefox and IE, as expected.

Have you tried testing your form with a static HTML version of the page
that submits back to itself? At least you could establish baseline
functionality then begin to work toward whatever additional code
elements are causing the unexpected behavior.

My two cents,
John

Feb 21 '06 #2
Dear John,

I have worked with forms quite a lot of times earlier. I couldnt figure
out why its happening this time. Basically I dont quite understand
where IE picks up "from_products_page" from "act=from_products_page" in
the querysting.

The hidden field details:
<div id = "products_buy">
<input type="hidden" name="act" value="from_products_subsets_page"/>
<input type="submit" name="sendd" value="Confirm And Buy">
</div>

Even in my JS page, I never found a trace of "from_products_page". The
phrase "from_products_page" appears in a different page altogether. How
does IE pick it up from that page? Any clue? Could it be possible that
IE in my system is corrupted and that I need to install it again ??

Firefox works in exactly the expected way.

Many thanks for your time John,

Regards, Chaitu..

Feb 22 '06 #3
VK

ch***********@gmail.com wrote:
and a javascript function is supposed to submit it as below:

var action;
action = "../products/template6_cart_details.asp";
document.getElementById('form_subset_products').ac tion = action


I would blame (besides bad spirits :-) on the above.

Try instead:
....
var a = "../products/template6_cart_details.asp";
document.forms['form_subset_products'].action = a;
....

That *should* help;

Feb 22 '06 #4
Dear John & VK,

I have figured out the problem. There were some dynamic forms that are
created in DHTML layers that are generetad dynamically.. Initially I
thought of each layer as a seperate form. So there are many many extra
forms as the number of categories in the page. Firefox simply ignores
them but IE recognized that the names of all the generated forms are as
same as of the one I have been trying to call from Javascript.

So i have figured out a point that if there are multiple forms in a
page with same name, IE treats the first form that renders first as
default whereas Firefox treats the last one.

Found a new difference in the way the 2 browsers handle requests huh :)
atleast I have..

So many thanks again for your time..

Regards.. Chaitu

Feb 22 '06 #5
VK wrote:
ch***********@gmail.com wrote:
and a javascript function is supposed to submit it as
below:

var action;
action = "../products/template6_cart_details.asp";
document.getElementById('form_subset_products').ac tion = action


I would blame (besides bad spirits :-) on the above.

Try instead:
...
var a = "../products/template6_cart_details.asp";
document.forms['form_subset_products'].action = a;
...

That *should* help;


Don't be silly, a declared local variable masks all properties with
names that correspond with the variable's Identifier on any object on
the scope chain below the Activation/Variable object. There can be no
naming collision here, it makes no sense even to be suggesting this as a
problem causing possibility, or that these changes would alter anything.

Richard.
Feb 23 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Lars Plessmann | last post by:
Problem: I try to store data in a objects field and read it out again. Sounds easy, yeah. But its a bit tricky here.... ;-) This is the class Customer.php with some setter and getter functions...
7
by: Aaron Prohaska | last post by:
I have just run into a problem where I have a page that posts back to itself to execute code, except when the page does the post back it somehow executes code that is in our home page for the site....
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
4
by: Daniel | last post by:
Hello, i have an assembly which is developped in C#.NET. The assembly provides two classes, one class has a method which accepts an instance of the other class as a parameter, like this: ---...
5
by: Vishal | last post by:
Hello, I already asked this question in the ASP.NET forums, but no help came. So I am hoping that somebody can help me out. This is really very URGENT me. For my e-commerce application, I...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
4
by: Antonio Carpentieri | last post by:
Hi all, in my previous post I've wrong typed some tems.. this is the corrected post. in a aspx page I have a repeater like this: <asp:repeater id=repeaterResults runat="server"...
6
by: TPJ | last post by:
Help me please, because I really don't get it. I think it's some stupid mistake I make, but I just can't find it. I have been thinking about it for three days so far and I still haven't found any...
0
by: deacon57 | last post by:
FYI - If you are a computer scientist (or geek), this post may be for you. I wanted to log any search keywords, etc that are used on my site. I created a simple program that logs search terms...
7
xNephilimx
by: xNephilimx | last post by:
lHi guys! I'm having a little problem that's getting on my nerves, I couldn't find a solution, I also tryed googling it and I found nothing... (my field of expertise is in AS 2 and 3, but I still...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.