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

http://localhost/scheduler/mobidx.php?next=9+Next

Here’s the code (passed W3C Validator)

<?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

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?

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

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 :shifty: )

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.