|
Posted by Petr Vileta on March 19, 2008, 11:29 pm
Please log in for more thread options Stanimir Stamenkov wrote:
> Is there a way to specify a default submit button in case there are
> more than one in a form? That is, to specify which button will be
> triggered as default action when pressing Enter in a form field.
>
> Currently I observe only the first submit button appearing in the
> document order is triggered:
>
> <form action="">
> <div>
> <label>Field 1: <input type="text" name="field1"></label></div>
> <div>
> <label>Field 2: <input type="text" name="field2"></label></div>
> <div>
> <input type="submit" name="operation" value="Create">
> <input type="submit" name="operation" value="Update">
> <input type="submit" name="operation" value="Delete"></div>
> </form>
Maybe somebody correct me but in many cases (and browsers) a default button is
a first one. In other word if I have a form with some text inputs and two
submit buttons called "Yes" and "No" and I want the "No" will be default then
I place "No" buttone before "Yes". This solution is not 100% secure but work
in most cases.
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your
mail from another non-spammer site please.)
Please reply to <petr AT practisoft DOT cz>
|