Hi.
I can't see my last post, so can't add to the thread.
but is this the correct way to do it:
adding the form.var.phone before the accept?
def testform():
record = db(db.config.type=="SMS_NUMBER").select(db.config.txt).first()
smsNumber = record.txt if record else ''
form=FORM('Phone Number:',
INPUT(_name='phone', type='string', requires=IS_NOT_EMPTY()),
INPUT(_type='submit'))
form.vars.phone = smsNumber
if form.accepts(request,session):
response.flash = 'form accepted'
db.config.update_or_insert(
db.config.type=='SMS_NUMBER',
type='SMS_NUMBER',
txt=form.vars.phone
)
elif form.errors:
response.flash = 'form has errors'
return dict(form=form)
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.