>From time to time I have the need for a form but I wish to validate
one or two lead items before I display the rest of the form for input.
The two ways I have approached this are --

1) Javascript. If the validation is rather simple I use Javascript. I
build a custom form with a properly placed <Div>, and use the
jquery .hide() to screen the balance of the form till the inputs are
validated. validation done before the form.accepts. if validated
trigger .show().

2) Split controllers. Controller1 performs a SQLFORM with fields=[]
limited to those that need validation. If form.accepts then a redirect
to Controller2. Controller2 displays the whole form treating it like
an update to the original record.

There are smarter people than me on the list. Anyone doing a 'third
way' that is even simpler/better?



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to