Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Javascript (http://www.velocityreviews.com/forums/f68-javascript.html)
-   -   DOM problem in Mozilla (http://www.velocityreviews.com/forums/t925887-dom-problem-in-mozilla.html)

sandipm 07-19-2006 02:05 PM

DOM problem in Mozilla
 
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


marss 07-19-2006 02:49 PM

Re: DOM problem in Mozilla
 

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 07-19-2006 02:59 PM

Re: DOM problem in Mozilla
 

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";



All times are GMT. The time now is 02:45 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.