SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have used this method a thousand times before to auto-submit a form, for some reason I cannot get it to work this time, anyone have any idea why?

    Code:
    <form action="/ufi/hs~hosting_order.php" method="POST" name="theform">
    <tr valign="top">
    	<td width="200" align="right"><span class="bodytext"><b>Selected Hosting Plan:</b></span>&nbsp;&nbsp;</td>
    	<td width="250"><select name="plan" class="ordernb" onChange="document.theform.submit(); ">
    <option value="1" selected>Shared Hosting - Plan A &nbsp; - 11.95
    <option value="2">Shared Hosting - Plan B &nbsp; - 19.95
    <option value="3">Shared Hosting - Plan C &nbsp; - 29.95
    <option value="4">Shared Hosting - Plan D &nbsp; - 49.95
    <option value="5">Shared Hosting - Plan E &nbsp; - 99.95
    </select>
    </td>
    </tr>
    </form>
    Last edited by freddydoesphp; Apr 19, 2001 at 16:18.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  2. #2
    SitePoint Addict isuru's Avatar
    Join Date
    Nov 2000
    Posts
    206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it looks ok to me, the only thing that I would change is:

    onChange="document.theform.submit(); "

    to
    onChange="document.theform.submit(); return 0;"

    other than that I cant think of anything else

  3. #3
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No dice I am getting a Obeject cannot support this message error.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Whats even weirder

    Code:
    <tr valign="top">
    	<td width="200" align="right"><span class="bodytext"><b>Selected Hosting Plan:</b></span>  </td>
    	<td width="250"><form action="/ufi/hs~hosting_order.php" method="POST" name="theform"><select name="plan" class="ordernb" onChange="document.theform.submit(); ">
    <option value="1" selected>Shared Hosting - Plan A   - 11.95
    <option value="2">Shared Hosting - Plan B   - 19.95
    <option value="3">Shared Hosting - Plan C   - 29.95
    <option value="4">Shared Hosting - Plan D   - 49.95
    <option value="5">Shared Hosting - Plan E   - 99.95
    </select>
    </form>
    </td>
    </tr>
    works fine, but that is not an option as the rest of the form needs to be sent as well not just the one drop down.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    not that it'll help but you should get into the habit of closing your option tags since it's xhtml compatible and really the way you're supposed to do it now.
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums

  6. #6
    JavaScript Guru (Big Ego) Arielladog's Avatar
    Join Date
    Jul 1999
    Location
    SC, USA
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey freddy, et all,

    The code looks fine to me and when tested, it works. My bet is its something else in the document that's confusing it...

    aDog

  7. #7
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it is just too weird, I can't figure it out, I mean there is only one form on the page.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  8. #8
    I believe you have my stapler. scrubz's Avatar
    Join Date
    Feb 2001
    Location
    Van down by the river
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, the code you posted worked fine here too. There must be something else in the page causing the error. Post the rest of the code if you can and maybe we can narrow it down from there.

  9. #9
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I finally figured it out, if you have a submit button named "submit" you cannot auto submit forms with javascript.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


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
  •