[thelist] Another submit button for cancel

Chris Heilmann lists at onlinetools.org
Wed Dec 15 10:19:02 CST 2004


> On Wed, 15 Dec 2004 09:55:55 -0000, Bird, Graham
> <Graham.Bird at rspb.org.uk> wrote:
>> My current idea is to have a second submit button (valid under W3C
>> specs)...
>> and send the user back to the page they came from if the submit value =
>> "Cancel".
>> Is this a good idea, or am I stumbling blindly into a world of pain?
>
> There's no problem with this as long as your server side scripting
> handles both values correctly.
>
> Alternatively, you could simply add a button with some Javascript to
> send the user to the previous page (if the cancel button only needs to
> go back without talking to the server):
>
> <input type="button" onclick="window.history.back()" value="Cancel" />

And thereby successfully add a useless interactive page elements (when
Javascript is not available). If you want to use things like that, please
do the decent thing and _add_ them via Javascript, too.

Personally I think the two button approach is not a bad idea, just make
sure to add the submit button first to avoid users cancelling without
wanting to.

-- 
Chris Heilmann
http://icant.co.uk/ | http://www.onlinetools.org/



More information about the thelist mailing list