views:

181

answers:

1

I have a form element I want to use in many forms, a standard submit button.

<div dojoType='dijit.form.Button' type='submit' 
    iconClass='dijitEditorIcon dijitEditorIconRedo' 
    style='float:left;margin:0 2px 00;padding:0;'
    onClick=\"filter{$this->_grid->getId()}(); return false;\">Refresh
</div>

Current, this submit buttons works when clicked on, but the form does not submit when the enter key is pressed. Others have suggested a custom onkeypress event handler to submit the form when it catches the Enter key, but I'm hesitant because I don't want to break other forms on the page.

+2  A: 

Stuff that you want running on form submission should be on form onsubmit, not a particular button.

bobince