DOM problem in Mozilla

Discussion in 'Javascript' started by sandipm, Jul 19, 2006.

  1. sandipm

    sandipm Guest

    Hi all,
    I am facing problem with updating form element using javascript in
    MOZILLA
    Details are as follows.
    I have a div containing form element. on submit , i am submitting the
    form using javascript-ajax and processing the form. then after
    successfully processing i am replacing innerHTML of div with same
    form. I am able to see same form on page after ajax update but when i
    refill the form and submit it again..javascript is not able to find the
    form element in HTML DOM.

    This problem comes with mozilla-firefox but it works fine with IE 6

    Can anybody help me with this?

    Regards,
    Sandip More
    sandipm, Jul 19, 2006
    #1
    1. Advertising

  2. sandipm

    marss Guest

    sandipm напиÑав:
    > Hi all,
    > I am facing problem with updating form element using javascript in
    > MOZILLA
    > Details are as follows.
    > I have a div containing form element. on submit , i am submitting the
    > form using javascript-ajax and processing the form. then after
    > successfully processing i am replacing innerHTML of div with same
    > form. I am able to see same form on page after ajax update but when i
    > refill the form and submit it again..javascript is not able to find the
    > form element in HTML DOM.
    >
    > This problem comes with mozilla-firefox but it works fine with IE 6
    >
    > Can anybody help me with this?
    >
    > Regards,
    > Sandip More


    Merely supposition.
    Try to replace not form but only its content:

    Instead of
    <div id="outerDIV">
    <form id="frm">
    .....
    </form>
    </div>

    try
    <form id="frm">
    <div id="innerDIV">
    .....
    </div>
    </form>

    and replace document.getElementById("innerDIV").innerHTML
    Maybe it helps.
    marss, Jul 19, 2006
    #2
    1. Advertising

  3. sandipm

    marss Guest

    marss напиÑав:
    > sandipm напиÑав:
    > > Hi all,
    > > I am facing problem with updating form element using javascript in
    > > MOZILLA
    > > Details are as follows.
    > > I have a div containing form element. on submit , i am submitting the
    > > form using javascript-ajax and processing the form. then after
    > > successfully processing i am replacing innerHTML of div with same
    > > form. I am able to see same form on page after ajax update but when i
    > > refill the form and submit it again..javascript is not able to find the
    > > form element in HTML DOM.
    > >
    > > This problem comes with mozilla-firefox but it works fine with IE 6
    > >
    > > Can anybody help me with this?
    > >
    > > Regards,
    > > Sandip More

    >
    > Merely supposition.
    > Try to replace not form but only its content:
    >
    > Instead of
    > <div id="outerDIV">
    > <form id="frm">
    > .....
    > </form>
    > </div>
    >
    > try
    > <form id="frm">
    > <div id="innerDIV">
    > .....
    > </div>
    > </form>
    >
    > and replace document.getElementById("innerDIV").innerHTML
    > Maybe it helps.


    Or else

    var newForm=document.createElement("FORM");
    ......
    //recreate form content
    .......
    newForm.style.display="none";
    existingForm.parentNode.insertBefore(newForm, existingForm);
    existingForm.parentNode.removeChild(existingForm);
    newForm.style.display="block";
    marss, Jul 19, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Henri
    Replies:
    9
    Views:
    1,811
    Toby Inkster
    Feb 22, 2005
  2. Kenneth McDonald

    Interacting with Mozilla DOM?

    Kenneth McDonald, Sep 23, 2006, in forum: Ruby
    Replies:
    2
    Views:
    92
    David Vallner
    Sep 30, 2006
  3. J. Baute
    Replies:
    3
    Views:
    97
    J. Baute
    Apr 19, 2005
  4. Mozilla DOM Element

    , Jul 3, 2006, in forum: Javascript
    Replies:
    8
    Views:
    94
  5. Vince Morgan

    Mozilla and DOM

    Vince Morgan, Oct 29, 2006, in forum: Javascript
    Replies:
    4
    Views:
    63
    Randy Webb
    Oct 31, 2006
Loading...

Share This Page