SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast athena's Avatar
    Join Date
    Apr 2002
    Location
    Vancouver, Canada
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question onChange submit() not working

    I know I've done this little trick before, but for some reason I can't get it to work this time around. This is being implemented on a PHP page:

    HTML Code:
     <form name="Form1" action="?op=stamp-list" method="post">
     
     <select name="section" onChange="javascript:Form1.submit()">
     <option value="">--Select--</option>
     <option value="2" selected>Tibet</option>
     ...
     </select>
     
     </form>

    When I use the select box IE is returning a script error: "Object doesn't support this property or method"

    I'm sure I'm just forgetting something simple... any ideas?

  2. #2
    SitePoint Wizard chris_fuel's Avatar
    Join Date
    May 2006
    Location
    Ventura, CA
    Posts
    2,750
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try:

    Code:
    onChange="document.forms['Form1'].submit();"

  3. #3
    SitePoint Enthusiast athena's Avatar
    Join Date
    Apr 2002
    Location
    Vancouver, Canada
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That fixed it. thanks!


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
  •