SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict
    Join Date
    Oct 2005
    Posts
    288
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Unexpected URL on xhtml form action

    Just started initial coding for mobile devices (see DOCTYPE).

    The form action specifies
    <form action="/scheduler/mobidx.php?task='registration1'">
    But upon clicking the submit button, the URL reflects the submit button value
    Here's the code (passed W3C Validator)
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
     <title>Mobile Registration p1</title>
     <meta name="description" content="Preference Registration via mobile" />
    </head>
    <body>
     <form action="/scheduler/mobidx.php?task='registration1'">
      <fieldset id="preferences">
       <p>Preferences<br />Check one or both choices</p>
       <ol>
        <li>
         <input type="checkbox" id="desktopop" accesskey="1" title="Enable Desktop" name="preference" />
         <label for="desktopop">I will use desktop</label>
        </li>
        <li>
         <input type="checkbox" id="mobileop" accesskey="2" title="Enable Mobile" name="preference" />
         <label for="mobileop">I will use mobile device(s)</label>
        </li>
       </ol>
      </fieldset>
      <fieldset id="action">
       <input type="submit" id="next" name="next" value="9 Next" />
       <input type="submit" id="cancel" name="cancel" value="0 Cancel" accesskey="0" />
      </fieldset>
    </form>
    </body>
    </html>
    I will get around this by embedding and $_POST inquiring on a hidden field with my "task" value, but curious as to why this is happening. [Prior to acquiring mobile emulators, This is running/testing on desktop browsers FF 4.0.1 and IE 8.0]

    grNadpa

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,271
    Mentioned
    197 Post(s)
    Tagged
    3 Thread(s)
    I've never tried it so I don't know, but maybe if you don't explicitly state a form tag's method attribute to POST it defaults to GET?

  3. #3
    SitePoint Addict
    Join Date
    Oct 2005
    Posts
    288
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks Mittineague

    Wow, is THAT embarrassing!!!!

    Adding
    method="post"
    to the form action did the trick.

    A mind is a terrible thing to lose.

    grNadpa

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,271
    Mentioned
    197 Post(s)
    Tagged
    3 Thread(s)
    I've had my share of embarrassments and I expect I haven't had the last.

    One good thing, I don't make the same mistake twice. (we'll, usually )

  5. #5
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    That's the line I always use in job interviews. "I'll make every mistake in the book, but I'll only make them once." Seems to work.


Tags for this Thread

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
  •