Clear form

You cannot have more than one button per form - the action that the form is submitted to is defined in the form tag and has nothing to do with the button.

you can the clear form outside the form - perhaps in the form of a link, rather than a button, or you can create a form with just the clear button in. anyway, what I woudl do is post to a ajax function that replaces the form with an empty version of itself

if you like javascript you can clear the form without making a call to the server by setting all the form elements’s value to “”

I just tested your clear form button below and it works fine for me,
effectively clearing the form. You can not (automatically) have
multiple submit buttons (although this works w/ a tiny bit of
javascript), but you definitely can have a submit and a reset button as
the reset button does not post back. My guess is that there is
something else wrong with your html preventing it from being rendered
properly. Have you validated that page using the w3c validator?

Ivor Paul wrote:

If you just want to reset the form to it's initial state you could use:
<input type="reset" value="Reset Form" />


Ivor Paul wrote:

Correct, and thats exactly what this generates:

<%= submit_tag "Clear form", :class => 'inputsubmit', :type => 'reset' %>

Jesse Clark wrote: