473,480 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Form tags stripped out in FF with innerHTML

Hi

I have a piece of code which replaces the contents of a div using
innerHTML

e.g. this.targetDiv.innerHTML = '<form name="test" id="test1"> in form
</form>';

This works fine in IE but FF(1.5.04) strips out the <form> and </form>
tags.

I know there are some differences in how these browsers handle
innerHTML but I can't seem to find anything on this specific problem.

Does anyone have any idea why this is happening?

Thanks.

G

Jun 8 '06 #1
2 1841


geed_dd wrote:
I have a piece of code which replaces the contents of a div using
innerHTML

e.g. this.targetDiv.innerHTML = '<form name="test" id="test1"> in form
</form>';

This works fine in IE but FF(1.5.04) strips out the <form> and </form>
tags.


Is there already a form element as an ancestor of the target div?
What does DOM inspector show?

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jun 8 '06 #2
Thanks for the quick reply and advice.

There is a misplaced form element ancestor. I should have spotted this
as I've come up across this before.
Martin Honnen wrote:
geed_dd wrote:
I have a piece of code which replaces the contents of a div using
innerHTML

e.g. this.targetDiv.innerHTML = '<form name="test" id="test1"> in form
</form>';

This works fine in IE but FF(1.5.04) strips out the <form> and </form>
tags.


Is there already a form element as an ancestor of the target div?
What does DOM inspector show?

--

Martin Honnen
http://JavaScript.FAQTs.com/


Jun 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3315
by: Matt Herson | last post by:
I am looking for a validation script that will only look at the fields in the cgi form, determine if the fields are filled out, then if one or more are blank will write a message at the top of the...
3
4480
by: Matt Herson | last post by:
I am using the following script given in an earlier post: <script type="text/javascript"> function validate(form) { for (var i = 0; i < form.elements.length; i++) { var elem = form.elements;...
6
4492
by: jiing24 | last post by:
I try to use regexp to replace some html tags in DOM, but the result seems some problems, ================================ <Script language="javascript" type="text/javascript"> var config =...
3
3494
by: Nebulus | last post by:
I'm having a really hard time with IE's innerHTML property and <form> tags. If I use this code: myDiv.innerHTML = "<form>This is a test</form>" in fireFox, the div tag shows the content....
6
1992
by: Sundew Shin | last post by:
I think I can make a good interesting list of postings under this subject header, 'All browsers are cool but IE.' Anyway, the following code will show a table with an input box labeled, 'name',...
3
2035
by: Swaine77 | last post by:
:confused: I've asked my professor about this one a couple of times in email and she gave me some tips but I still can't nail this one down. Our book only gives one example of using .innerHTML...
6
1957
by: vunet.us | last post by:
Hello, I have an html form which users fill out and submit. The form contains one textarea which I want them to preview before submitting. This, probably, means that there will be a link/button...
2
1985
by: ravisuguna | last post by:
Hi, I have a php page which has some checkboxes ,textfields and values.If I select a checkbox ,a particular value will be displayed in a textfield.I have a "go"button in the same page.I want the...
0
7049
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7052
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6744
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5348
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4790
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4488
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2989
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1304
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
565
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.