form.submit() not working sometimes in IE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ryan Cox

    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.s tyle.cursor = "wait";
    var oForm = document.getEle mentById("GetEn titlementsForm" );
    oForm.target = "DataExchangeFr ame1";
    oForm['GetEntitlement sForm_DriverVal ue'].value = DriverValue;
    oForm['GetEntitlement sForm_WhatToDo'].value =
    "GetEntitlement List";
    oForm.submit();
    } catch(ex) {
    alert("There was an error!");
    alert(ex);
    }
    //////////////////////////////////////////////////////////

    Thanks in advance.
  • Peter

    #2
    Re: form.submit() not working sometimes in IE

    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.GetEn titlementsForm) {
    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.0 307151215.4a833 a99@posting.goo gle.com...[color=blue]
    > 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.s tyle.cursor = "wait";
    > var oForm = document.getEle mentById("GetEn titlementsForm" );
    > oForm.target = "DataExchangeFr ame1";
    > oForm['GetEntitlement sForm_DriverVal ue'].value = DriverValue;
    > oForm['GetEntitlement sForm_WhatToDo'].value =
    > "GetEntitlement List";
    > oForm.submit();
    > } catch(ex) {
    > alert("There was an error!");
    > alert(ex);
    > }
    > //////////////////////////////////////////////////////////
    >
    > Thanks in advance.[/color]


    Comment

    Working...