Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Aug 2004
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    importing new <form> tag

    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??

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    You cannot have nested forms. So you must take out 'mydiv' inside the form.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    Regular Coder
    Join Date
    Aug 2004
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    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>
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #5
    Regular Coder
    Join Date
    Aug 2004
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts
    no-no. i use this:
    [div id='mydiv'][/div]

    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....
    Last edited by looka; 01-28-2005 at 08:49 AM.

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    I don't get what you're saying. Can you post the whole code or a link to the page in question?
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #7
    Regular Coder
    Join Date
    Aug 2004
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i simply want to say i cannot safely (for IE) import new forms in my page. html goes:

    [head] blahblah...
    [/head]
    [body]
    [div id="mydiv"] [/div]
    [table] [tr] [td] and so and so,

    ...[a href="javascript:document.getElementById('mydiv').innerHTML=getFile('http:myaddres.com/form.php');"] click [/a]

    ....[/body]

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •