Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent submission on enter key #119

Open
npearson72 opened this issue Apr 27, 2015 · 5 comments
Open

Prevent submission on enter key #119

npearson72 opened this issue Apr 27, 2015 · 5 comments

Comments

@npearson72
Copy link

When I was using the standard angular ng-submit on my forms, hitting the enter key while in an input field did not submit the form. Now using AA it does.

Is there a way to only submit the form when explicitly clicking the submit button?

@npearson72
Copy link
Author

No word on this?

@johnculviner
Copy link
Member

its because of this: https://github.com/AngularAgility/AngularAgility/blob/master/src/formExtensions/directives/ngForm.js#L432-432

and this:

https://github.com/AngularAgility/AngularAgility/blob/master/src/formExtensions/directives/aaSubmitForm.js#L45-45

thats probably an extensiblity point that needs to get built in to the provider in order to do that

@npearson72
Copy link
Author

"thats probably an extensiblity point that needs to get built in to the provider in order to do that"

I'm not sure what you mean by that?

@johnculviner
Copy link
Member

Actually it looks like if you remove the type="submit" from the aa-submit-form directive target element (the button you have it on) it won't auto do it anymore. Give that a shot. Lemme know.

https://github.com/AngularAgility/AngularAgility/blob/master/src/formExtensions/directives/aaSubmitForm.js#L43

@theanxy
Copy link

theanxy commented Aug 13, 2015

@johnculviner This workaround does solve the problem, thanks.

(Keep up the great work, guys!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants