you can just do form.vars.whatever=.... before accepts.
On Jun 7, 5:27 pm, JohnMc <maruadventu...@gmail.com> wrote:
> Populate the field after the form has been submitted.
>
> On Jun 7, 4:05 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > are you trying to prepopulate the options in the form before it is
> > submitted or populate fields after the form is submitted before the
> > record is inserted?
>
> > Massimo
>
> > On Jun 7, 2:59 pm, JohnMc <maruadventu...@gmail.com> wrote:
>
> > > Controller:
>
> > > newform=SQLFORM(docs.docs,uploadfield=True, \
> > > fields=['supplier','supplierID'])
>
> > > if newform.accepts(request.vars,session):
> > > response.flash = "Data accepted"
> > > return dict(form=newform)
>
> > > I acquire the supplierID as a dropdown using this in the model --
>
> > > docs.docs.supplierID.requires=IS_IN_DB(dbhlx
> > > (dbhlx.contact.category=='supplier'),dbhlx.contact.contactid,\
> > > '%(contactid)s')
>
> > > The contactid's provided from a different db. All works fine.
>
> > > Without using Crud, is there a means to populate the supplier field
> > > before form.accepts() is executed? Slipping in some print statements I
> > > notice that request.vars are, one state before submit and one state
> > > after submit.
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to
web2py+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---