Results 1 to 8 of 8

Thread: Dynamic Ajax Content: Innerhtml and form issue

  1. #1
    Join Date
    Dec 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Dynamic Ajax Content: Innerhtml and form issue

    [SOLVED]

    1) Script Title:
    Dynamic Ajax Content
    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...jaxcontent.htm
    3) Describe problem:

    This script worked like a charm ( thank you to the author('s) ), however I managed to break it.

    I have an input form for "new" users, I have a dropdown list that throws existing user details into a <div> using the script.

    However, when I take that dropdown goes back to the default, that is the input form, out favourite browser IE throws a JavaScript error...

    Error: Object doesn't support this property or method
    Thanks to this chap, I have narrowed it down to "The short answer is that form is a non-block element and you cannot insert a block element inside a non-block element".

    However I have no idea how to fix this in my case.

    The line that throws the error is ( line 42 from the "function loadpage").

    document.getElementById(containerid).innerHTML=page_request.responseText
    TIA
    Last edited by scraf; 12-05-2006 at 08:25 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Where is the form to begin with? Is it on the 'top' page or on an external page? If it is on the 'top' page, I don't believe this script is written to accommodate that, unless the form is also on an external page. On the external page, if the HTML isn't valid, that will present problems. You can validate your external page (by itself) here:

    http://validator.w3.org/
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Validation hasn't been on my list of priorities as this is only for an admin section for a site, and at first look will probably take a lot of debugging.

    The form is originally in the <div> that the script talks to

    The form in that div gets replaced by other external data ( other pages ) through choices from the select dropdown.

    However when that external data contains a form ( I actually want it to be the same one that originally shows ), then IE throws the error.

  4. #4
    Join Date
    Dec 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hmm, a workaround could be if I could some how get the css to have a "display:none" for the form when weaving the Ajax magic.

    Which would probably involve using an iframe instead I guess.

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I'm pretty good at getting pages to validate. If your external page containing the form isn't too complex, I'd be happy to validate it for you. Please supply a link to it (preferred) or the full and exact code*. There could be other problems but, in the past this (invalid markup) has proven to be the problem in cases like this so, you have to at least start with valid markup.



    *Please provide your code -

    PLEASE: Include the URL to your problematic webpage that you want help with. (Best)

    OR:

    Put code tags:

    [code]

    code goes here

    [/code]

    around your code (as explained here) in a message here so that it appears like so:

    Code:
    code goes here
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Dec 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You're probably right about the validation John, I ran a test and no problems...

    http://scraf.nl/ajax/test.php

    I'll pm you the actual page with the problem ( IE only issue ), and walk away for an hour ( spent far too long behind the screen ).

    Validation is not important for the actual page, and I, er got, 60 errors.

  7. #7
    Join Date
    Dec 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    [SOLVED]

    ( Wish I could add that to the title of the thread )

    jscheuer1 hit the nail right on the head with the validation prognosis.

    Speaking of heads, I had forgotten to close the <head> tag in the code.

    Problem solved.

  8. #8
    Join Date
    Dec 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Footnote: '<select id="ajaxmenu" onChange=' .....didn't validate

    '<select id="ajaxmenu" onchange=' .... did

Bookmarks

Posting Permissions

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