[web2py] Re: How can I change a form so that the Enter key is disabled for Submit

2015-02-03 Thread Tom Stratton
Thanks -

I found several methods on SO that involved manipulation of the OUTPUT from 
web2py that gets rendered in the browser. Implemented a solution that was 
very specific to the forms that I want to have filled in.

I had hoped for a web2py specific way to manage the submit button behavior 
because of this observed behavior:

   - In web2py, for list fields, enter adds a new value to the list
   - in web2py, for text fields, enter creates a line break in the 
   input.

These are great behaviors but they put the users into the habit of pressing 
enter and the fields that I was validating are not amenable to an a-priori 
decision about whether the form is completely filled in or not as blank 
fields are acceptable and common.

Ultimately, I disabled the enter key on a field-by-field basis using jquery 
and left the behavior as-is for any field with list in the name.

Thanks for the suggestions!

Tom

On Friday, January 30, 2015 at 1:34:52 PM UTC-8, Niphlod wrote:

 there are a lot if you want to do down that path.


 http://stackoverflow.com/questions/895171/prevent-users-from-submitting-form-by-hitting-enter

 IMHO disabling enter is not a solution (I'm a keyboard guy and I love to 
 send forms with enter): at the very minimum you should do a proper 
 validation (server-side with web2py is easy). The most elegant way is to 
 disable the submit button via javascript until all required fields are 
 filled. 


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How can I change a form so that the Enter key is disabled for Submit

2015-01-30 Thread Niphlod
there are a lot if you want to do down that path.

http://stackoverflow.com/questions/895171/prevent-users-from-submitting-form-by-hitting-enter

IMHO disabling enter is not a solution (I'm a keyboard guy and I love to 
send forms with enter): at the very minimum you should do a proper 
validation (server-side with web2py is easy). The most elegant way is to 
disable the submit button via javascript until all required fields are 
filled. 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.