If some fields should not apper in the form and therefore should not
be modified by visitor you should do

db.table.field.writable=False

On Apr 24, 8:53 am, Paul Wray <[email protected]> wrote:
> Thank you that works beautifully.
>
> (Sorry,  only skimmed the crud chapter , and the info regarding custom
> forms is in there.)
>
> One more  thing though:
> if I omit some widget fields from the HTML form,
> (in this case, a reference field to another table),
> form.accepts fails like it has null values, even though the
> correct values have been placed in form.vars and so are in the wdget
> initially.
>
> Is the way around this to place such fields in a hidden DIV?
>
> On Apr 23, 3:23 pm, mdipierro <[email protected]> wrote:
>
> > You can. Did you try
>
> > {{=form.custom.begin}}
> > <input ....>
> > {{=form.custom.end}}
>
> > On Apr 22, 11:35 pm,PaulWray<[email protected]> wrote:
>
> > > I too have tried this without success.
>
> > > I seems that you cannot use a custom form together with SQLFORM with
> > > record=
> > > Is that true?
>
> > >Paul
>
> > > On Apr 9, 6:14 am, JmiXIII <[email protected]> wrote:
>
> > > > Hello,
>
> > > > I'm using a SQLFORM with a html custom (as described in book/7.2 =>
> > > > SQLFORM in HTML)
> > > > My fonction inside my controller is :
>
> > > > def ncmodif():
> > > > ### Formulaire de saisie des NC de production
> > > >     rec=db(db.NC.id==269).select()[0]
> > > >     form=SQLFORM(db.NC,record=rec)
> > > >     if form.accepts(request.vars,formname='test'):
> > > >         response.flash = 'form accepted'
> > > >     elif form.errors:
> > > >         response.flash = 'form has errors'
> > > >     else:
> > > >         response.flash = 'please fill the form'
> > > >     return dict()
>
> > > > I have hardcoded db.NC.if==269 for the moment to see how it works.
>
> > > > My view is something like:
> > > > <form><input name="FieldName"/>....<input type="hidden"
> > > > name="_formname" value="test" />....
>
> > > > My question is there a simple way to make this form work as it works
> > > > with the standard way (ie when using {{=form}}) to update the record
> > > > via the custom form ?
> > > > Can I have the input field prepopulated and updated when I submit
> > > > since ncmodif() does not return any value ?
>
> > > > Thanks
>
> > > > --
> > > > You received this message because you are subscribed to the Google 
> > > > Groups "web2py-users" 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 
> > > > athttp://groups.google.com/group/web2py?hl=en.

Reply via email to