--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/tgTvG8OqWso/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/b4575285-7562-4a55-9470-0adfcbe354f1%40googlegroups.com.
I was hoping to avoid those tricks. I too have done this by storing values in the session to be redisplayed. I was hoping that the keepopts argument to SQLFORM would allow you to specify which fields to keep, but it seems that is used for something else.
On Thu, Apr 30, 2020 at 11:48 AM Scott Hunter <shu...@nycap.rr.com> wrote:
I recall doing this by "pre-populating" the field you want to keep with the old value.--- Scott
On Thursday, April 30, 2020 at 11:10:42 AM UTC-4, Jim S wrote:Does anyone know how I can have a form 'keepvalues' but only keep one specific field value? I don't want it to keep the values for all the fields, just for the one specific field.Anyone tried this before?-Jim
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/tgTvG8OqWso/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web...@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/14c77d74-1910-4b05-9b88-fac8bef5cf05%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/14c77d74-1910-4b05-9b88-fac8bef5cf05%40googlegroups.com.
def update_something():
fields = [Field('name'),
Field('address', 'text'),
Field('city'),
Field('state'),
Field('zip_code')]
form = SQLFORM.factory(*fields)
if form.process().accepted:
# update the database here
return dict(form=form)
form = SQLFORM.factory(*fields) if form.process().accepted: # update the database here
form2 = SQLFORM.factory(*fields) form2.vars['state'] = form.vars.state form2.process() else: form2 = form return dict(form=form2)