|
|
form.submit() not working sometimes in IE
I'm submitting a form using the following code and sometimes, it
doesn't get submitted. I have Tomcat 4.1.24 on the backend and I am
trying to grab some extra information from the server for my current
page. I do this by submitting a form and setting the target as an
iFrame on my page. It works like 85% of the time. The other 15% of the
time, IE just sits there and times out. When a place a sniffer on the
port, the Post is never going through. I can't hit anything on the
current session anymore either. Is this a known issue with IE? Does
anyone know of a workaround?
Code....
//////////////////////////////////////////////////////////
try {
document.body.style.cursor = "wait";
var oForm = document.getElementById("GetEntitlementsForm");
oForm.target = "DataExchangeFrame1";
oForm['GetEntitlementsForm_DriverValue'].value = DriverValue;
oForm['GetEntitlementsForm_WhatToDo'].value =
"GetEntitlementList";
oForm.submit();
} catch(ex) {
alert("There was an error!");
alert(ex);
}
//////////////////////////////////////////////////////////
Thanks in advance.
|
|
0
|
|
|
|
Reply
|
RyanLCox
|
7/15/2003 8:15:48 PM |
|
I wouldn't personally use the method to refer to the form ie getElementById.
Just use a with statement to cut down the code.
with (document.GetEntitlementsForm) {
target = "_self";
Driver.value = "someValue";
WhatToDo.value = "someValue";
submit();
}
This way makes it more readable and easy to edit. Is the try/catch clause
implemented yet? I wasn't aware that you could use this yet in JavaScript
although the words are reserved.
Peter.
"Ryan Cox" <RyanLCox@yahoo.com> wrote in message
news:8b197e07.0307151215.4a833a99@posting.google.com...
> I'm submitting a form using the following code and sometimes, it
> doesn't get submitted. I have Tomcat 4.1.24 on the backend and I am
> trying to grab some extra information from the server for my current
> page. I do this by submitting a form and setting the target as an
> iFrame on my page. It works like 85% of the time. The other 15% of the
> time, IE just sits there and times out. When a place a sniffer on the
> port, the Post is never going through. I can't hit anything on the
> current session anymore either. Is this a known issue with IE? Does
> anyone know of a workaround?
>
> Code....
> //////////////////////////////////////////////////////////
> try {
> document.body.style.cursor = "wait";
> var oForm = document.getElementById("GetEntitlementsForm");
> oForm.target = "DataExchangeFrame1";
> oForm['GetEntitlementsForm_DriverValue'].value = DriverValue;
> oForm['GetEntitlementsForm_WhatToDo'].value =
> "GetEntitlementList";
> oForm.submit();
> } catch(ex) {
> alert("There was an error!");
> alert(ex);
> }
> //////////////////////////////////////////////////////////
>
> Thanks in advance.
|
|
0
|
|
|
|
Reply
|
Peter
|
7/17/2003 4:46:02 AM
|
|
|
1 Replies
331 Views
(page loaded in 0.636 seconds)
|
|
|
|
|
|
|
|
|