[thelist] Default Button in a Form

Jay Blanchard jay.blanchard at niicommunications.com
Thu May 16 08:36:04 CDT 2002

Hello Experts,
How to set a <input type="button"> in a web page <form> as default when
it is NOT a <input type="submit"> button?

Actually there is no such thing a default form button. The only one with a
true default action is <input type="reset"> which clears changes made in the
form. <input type="submit"> invokes the form action. Do you want the submit
button to have a different display? Something like...

<input type="submit" value="Press This Button">



You can also have more than two buttons per form by using scripting to
handle them like a SELECT CASE (ASP) or SWITCH (PHP) I could have;

<input type="submit" name="action" value="Save">
<input type="submit" name="action" value="Update">
<input type="submit" name="action" value="Delete">

Where the variable "action" holds the "value". Using scripting I can then
see what CASE the "action" is and "do stuff" based on the CASE.

More information about the thelist mailing list