http://groups.google.com/group/web2py/browse_thread/thread/d09a7bbbb4f89f5d/9c13597a9af15c70?lnk=gst&q=custom+forms#9c13597a9af15c70
On May 22, 10:43 am, carlo <syseng...@gmail.com> wrote: > my solution is: > > {{if request.vars.myname:}} > {{myvalue=request.vars.myname}} > {{else:}} > {{myvalue='mydefault'}} > {{pass}} > <input type='text' name='myname' value='{{=myvalue}}'> > > any better? > > carlo > > On 22 Mag, 17:33, carlo <syseng...@gmail.com> wrote: > > > I forgot to mention that my form is pure html and in the controller I > > have: > > > form=FORM() > > if form.accepts > > (request.vars,session=None,formname='consuntivi',keepvalues=True): > > response.flash="OK" > > elif form.errors: > > response.flash="Errors" > > > I noticed that values inserted are always cleared after submission > > even if the field is not pre-populated. > > > My answer is that because the form=FORM() is never passed to the view > > I can not have my values kept. Correct? > > > Any work around for this leaving the form as pure html? > > > carlo > > > On 22 Mag, 17:12, carlo <syseng...@gmail.com> wrote: > > > > maybe trivial but I can not get the clue: I need to have a form pre- > > > populated with some values and I know you can do it with > > > form.vars.name='myvalue'. But when I submit the form with > > > keepvalues=True I get the form back with the pre-populated values and > > > not with the changes the user made. > > > > Any suggestion? > > > Thank you > > > > Carlo > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---