I'll assume all 3 buttons are input type="submit".

Does your form only have one field? If so, pressing return may submit the
form (as you note only in certain browsers). If you are just testing with
a simply form then the problem may go away with your actual production
form if it has more than one field.

If your buttons are ordered Delete, Cancel, OK you might want to arrange
them so that they are OK, Cancel, Delete (OK must be first). That should
cause the OK button to get the return keypress. If you need to maintain
Delete, Cancel, OK for presentation purposes you can try assigning those
buttons a tabindex attribute value where OK would have the lowest of the
three buttons. If you do this you will also probably need to apply that
attribute to every form element to maintain a desirable navigation level.
That said, I can't guarantee that this will cause return keypress to fire
the button with the lowest tabindex.

You will need Javascript to test if a button is actually clicked.

You can apparently use Javascript to prevent the enter/return key from
being detected. See http://www.irt.org/script/1693.htm.

-- Brad

> I want to have 3 buttons on a form. Delete, Cancel, OK. I use the
> code to test the value of the buttons and everything looked good.
> But then I realized that pushing the return was deleting the record.
> But also not in every browser.
>
> So what is the best way to have the OK button as the default which
> gets the enter | return and the other buttons only when clicked?

_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to