[html-formfu] add url to Cancel button

Carl Franks fireartist at gmail.com
Tue Oct 23 14:37:58 GMT 2007


On 23/10/2007, kewei xiao <kewei.xiao at nald.ca> wrote:
> Hi Carl
>
>    I am trying to add a url to my cancel button, so when I click cancel,
> it will direct me to main page.
>
>    here is what I've done so far:
>
>     - type: Block
>     elements:
>       - type: Submit
>         name: ok
>         id: ok
>         default_loc: "Ok"
>         retain_default: 1
>       - type: Button
>         name: cancel
>         default_loc: "Cancel"
>         attributes_xml: { onclick: "<a href='_uri_for(/admin)_'></a>" }
>
> Can you give me a hint on this?

Have you tried it?
If it doesn't work, what happens?

Personally, I don't like solutions that only work with JavaScript, so
I'm not especially inclined to investigate.

There's a message in the archives [1] that explains how to get Cancel
buttons working - though it also contains a link to Jakob Nielsen's
"Reset / Cancel Button Considered Harmful" [2] ;)

[1] http://lists.scsys.co.uk/pipermail/html-formfu/2007-August/000264.html
[2] http://www.useit.com/alertbox/20000416.html

Carl



More information about the HTML-FormFu mailing list