By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,382 Members | 1,623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,382 IT Pros & Developers. It's quick & easy.

form.submit() not working sometimes in IE

P: n/a
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.
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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" <Ry******@yahoo.com> wrote in message
news:8b**************************@posting.google.c om...
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.

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.