[web2py] Re: crud form errors
How do I highlight the fields with errors though? like it appears in the tutorials? example please. On Wednesday, 15 January 2014 14:41:11 UTC, Anthony wrote: Error messages are in form.errors.fieldname (if it is None, there is no error for that field). On Wednesday, January 15, 2014 8:49:23 AM UTC-5, sasogeek wrote: I have a crud login and registration form with my own html, I don't extend the layout.html. How do I display the form errors when a user submits empty or invalid inputs? -- 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/groups/opt_out.
[web2py] Re: crud form errors
It's up to you to code and style it as you like. Here's how web2py does it: https://github.com/web2py/web2py/blob/master/gluon/html.py#L1826. If you want it exactly as web2py does it, then just use form.custom.widget.fieldname instead of completely manual HTML. See http://web2py.com/books/default/chapter/29/07/forms-and-validators#Custom-forms . Anthony On Thursday, January 16, 2014 8:12:24 AM UTC-5, sasogeek wrote: How do I highlight the fields with errors though? like it appears in the tutorials? example please. On Wednesday, 15 January 2014 14:41:11 UTC, Anthony wrote: Error messages are in form.errors.fieldname (if it is None, there is no error for that field). On Wednesday, January 15, 2014 8:49:23 AM UTC-5, sasogeek wrote: I have a crud login and registration form with my own html, I don't extend the layout.html. How do I display the form errors when a user submits empty or invalid inputs? -- 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/groups/opt_out.
[web2py] Re: crud form errors
Error messages are in form.errors.fieldname (if it is None, there is no error for that field). On Wednesday, January 15, 2014 8:49:23 AM UTC-5, sasogeek wrote: I have a crud login and registration form with my own html, I don't extend the layout.html. How do I display the form errors when a user submits empty or invalid inputs? -- 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/groups/opt_out.