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 <mdipie...@cs.depaul.edu> wrote: > You can. Did you try > > {{=form.custom.begin}} > <input ....> > {{=form.custom.end}} > > On Apr 22, 11:35 pm,PaulWray<paul.w...@det.nsw.edu.au> 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 <sylvn.p...@gmail.com> 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 web...@googlegroups.com. > > > To unsubscribe from this group, send email to > > > web2py+unsubscr...@googlegroups.com. > > > For more options, visit this group > > > athttp://groups.google.com/group/web2py?hl=en.