grnadpa — 2010-05-17T09:21:58-04:00 — #1
My form contains
<input type="submit" name="save" value="Save" />
<input type="reset" name="reset" value="Reset" />
<input type="cancel" name="cancel" value="Cancel" />
</fieldset> <!-- choices -->
The submit and reset work as expected.
Interestingly, the submit and reset come up as buttons, but the cancel comes up as a box in Firefox/3.6.3 and IE 8.0.
More important, how do I detect (and redirect) when user clicks the "cancel"?
(Searched the archives -- must not be using correct keywords)
guido2004 — 2010-05-17T09:25:01-04:00 — #2
If you're using PHP:
grnadpa — 2010-05-17T09:44:02-04:00 — #3
Thank you for your prompt response.
Only the type="submit" invokes the php.
I can, of course, change the type="cancel" to type="submit" and check in my .php as you suggest. But thought there might be a detectable way to distinguish between the type="reset" and the type="cancel" without invoking (and complicating) the .php module.
felgall — 2010-05-17T15:41:04-04:00 — #4
There is no such HTML as <input type="cancel">
logic_earth — 2010-05-17T19:05:00-04:00 — #5
You know...there is zero need for a reset button. It is an accident wating to happen. Furthor more, why must the user hit "Cancel" to cancel? Could they just not submit the form and go some where else?
stomme_poes — 2010-05-18T04:21:49-04:00 — #6
Stephen, there is no type="cancel" in the specs... but why does Jim Thatcher mention it?? Is it a mistake?
felgall — 2010-05-18T04:42:49-04:00 — #7
That is a mistake. There are a number of new input types being introduced in HTML 5 and even HTML 5 does not have type=cancel. There is no such thing as type=cancel in any version of HTML. There is no need for it either since the easiest way to cancel a form is to just not press the submit button.
Just to make things easier here's the complete list
type=color (HTML 5 only)
type=date (HTML 5 only)
type=datetime (HTML 5 only)
type=datetime-local (HTML 5 only)
type=emaiil (HTML 5 only)
type=month (HTML 5 only)
type=number (HTML 5 only)
type=range (HTML 5 only)
type=search (HTML 5 only)
type=tel (HTML 5 only)
type=tiime (HTML 5 only)
type=url (HTML 5 only)
type=week (HTML 5 only)
xhtmlcoder — 2010-05-18T05:41:42-04:00 — #8
The nearest to a 'cancel', would be the 'cancelable' value appears within XForms but that's beyond the scope of HTML. I suspect Jim was thinking of common text rather than "type" and got muddled.
imcs — 2010-05-19T06:55:42-04:00 — #9
I think this will help. if not sorry...
all the best