Make the enter key execute a custom button

Often I do not use the standard “submit” button on forms.

For instance, sometimes I want a PHP button or a JScript button to be the “default” button.

Unfortunately, in the Form Settings, the “Use Enter To” only allows “submit” or “tab”.

To make your button execute when enter is pressed, create a JavaScript entry for “Form->onLoad” and plug this in:

$(document).keypress(function(e) {
if (e.which == “13”) {
sc_btn_my_button();
}
});

of course, substitute the name of your actual button in place of my_button.

Now, hitting the enter key is the same as clicking that button.

Dave