...

View Full Version : importing new <form> tag



looka
01-26-2005, 06:27 PM
hi, im using a bit modified vladdy's script to import some string in my existing html. okay, works perfectly.

problem accours, when the string contains form - somekind of error happens and explorer breaks down.

i simply want to (up to here everything goes okay)

document.getElementById('mydiv').innerHTML = mynewstring;

and then ******explorer has generated errors and will be shut down.


help??

glenngv
01-27-2005, 02:47 AM
You cannot have nested forms. So you must take out 'mydiv' inside the form.

looka
01-27-2005, 09:36 AM
hum - i don't have nested forms. the script goes like:

function getFile (addr){
oxmlhttp = null;
try {
oxmlhttp = new XMLHttpRequest();
oxmlhttp.overrideMimeType("text/xml");
}
catch(e){
try {
oxmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e) {
err='error occoured';
}
}
if(!oxmlhttp) err='error occoured';
try {
oxmlhttp.open('POST', addr);
}
catch(e){
err='error occoured';
}
if (err) return err;
return oxmlhttp.responseText;
oxmlhttp = null;
}

then i call:

document.getElementById('mydiv').innerHTML = getFile(addr);

and if on specified addres a table with a form inside happens, IE goes byebye...

glenngv
01-27-2005, 12:04 PM
Is the <div> with id 'mydiv' inside <form> tag like below?

<form>
<div id="mydiv">
<!--content goes here-->
</div>
</form>

If it is, then when the specified address returns response with <form></form> tags and set the response to mydiv, then you would have nested forms.

<form>
<div id="mydiv">
<form>...</form>
</div>
</form>

looka
01-28-2005, 09:06 AM
no-no. i use this:


then document.getElementById('mydiv').innerHTML = getfile(blahblah);


so, the form goes inside the mydiv, i guess. i use this mydiv also for other purposes:)

but, your idea with pre-creating a form tag is not so stupid... i'd just modify my script a bit so a form would be in a page when page loads....

glenngv
01-28-2005, 11:25 AM
I don't get what you're saying. Can you post the whole code or a link to the page in question?

looka
01-28-2005, 12:29 PM
i simply want to say i cannot safely (for IE) import new forms in my page. html goes:

blahblah...



[table] [tr] [td] and so and so,

... click

....

okay, it SHOULD work - but when form.php returns some form tag as a string, IE crashes.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum