form.submit() not working sometimes in IE

R

Ryan Cox

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.
 
P

Peter

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top