You need to use the onvalidation option in SQLFORM to do validation
spanning several columns:
def _validate_other(form):
if form.vars.select_field == 'Other' and not form.vars.other:
form.errors.other = 'Please provide a value'
form = SQLFORM(table, onvalidation=_validate_other)
On Monday, January 15, 2018 at 8:15:12 AM UTC-5, Javier Pepe wrote:
>
> Hi
>
> You can use de conditional show_if
>
>
> http://web2py.com/books/default/chapter/29/07/forms-and-validators#Conditional-fields
>
> db,table.text_field.show_if = (db.table.select_field == Other)
>
This is useful for
Hi
You can use de conditional show_if
http://web2py.com/books/default/chapter/29/07/forms-and-validators#Conditional-fields
db,table.text_field.show_if = (db.table.select_field == Other)
2018-01-12 23:19 GMT-03:00 vtcpe12 :
> Hi,
>
> I am utilizing the IS_IN_SET
Hi,
I am utilizing the IS_IN_SET functionality to produce a select box in my
SQLFORM. One of the options is 'Other'. I have another simple text box that
I would like to force the user to enter a value for if Other is selected in
the select box. Is that possible with the built in validators?
4 matches
Mail list logo