#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Posts
    14
    Rep Power
    0

    PHP and JAVASCRIPT (again)


    here is my code

    print(" document.writeln('<select onChange=ChangeDropDown(this.form) name=\"category\">');\n");

    print(" document.writeln('<option>Select a Category</option>');\n");

    print(" document.writeln('<option>graphics</option>');\n");
    print(" document.writeln('<option>programming</option>');\n");
    print(" document.writeln('</select>');\n");


    i believe that the onChange is creating an error.
    please help
  2. #2
  3. No Profile Picture
    <(>_~)>
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2002
    Posts
    315
    Rep Power
    13
    What *is* your error? Is there a parse error or is one of your JavaScripts not working?
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Posts
    14
    Rep Power
    0
    sorry about that

    IE says my error is "object expected"


    i dont know if that halps you at all
  6. #4
  7. No Profile Picture
    <(>_~)>
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2002
    Posts
    315
    Rep Power
    13
    If that error is not an error whichis generated by PHP, then I suggest you test your JavaScript as without it being parsed by PHP. If it still doesn't work, the problem is JavaScript related, and you should ask for help in the HTML, JavaScript and CSS forum.
  8. #5
  9. Feelin' Groovy
    Devshed Supreme Being (6500+ posts)

    Join Date
    Aug 2001
    Location
    WDSMIA
    Posts
    10,135
    Rep Power
    5053
    PHP Code:
    // Change this...
    print(" document.writeln('<select onChange=ChangeDropDown(this.form) name=\"category\">');\n");
    // To this...
    print(" document.writeln('<select onChange=\"ChangeDropDown(this.form)\" name=\"category\">');\n"); 
    What line number does IE give for the error? What is on that line?
    Last edited by Yawmark; August 8th, 2002 at 07:38 PM.
    Yawmark
    class Sig{public static void main(String...args){\u0066or(int
    \u0020$:"v\"ʲ\"vΤ\"".to\u0043h\u0061rArray()
    )System./*goto/*$/%\u0126//^\u002A\u002Fout.print((char)(($>>
    +(~'"'&'#'))+('<'>>('\\'/'.')/\u002Array.const(~1)\*\u002F)));}}
  10. #6
  11. Super Genius
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Orlando, Florida
    Posts
    314
    Rep Power
    13

    View the source


    "object expected" is a JavaScript error.

    Try viewing the source of the generated page, track down where that error is comming from and modify your PHP script as needed.
    Sleep is highly overrated.

IMN logo majestic logo threadwatch logo seochat tools logo