Re: [web2py] Form field defaults the second time through

2017-01-20 Thread Áureo Dias Neto
Change if form.process().accepted: form.vars.PostDate = request.vars.PostDate response.flash = T("Thank you!") to if form.process(keepvalues = True).accepted: response.flash = T("Thank you!") 2017-01-20 4:02 GMT-02:00 Armando Hernandez < armando.hernandez.ma...@g

[web2py] Form field defaults the second time through

2017-01-19 Thread Armando Hernandez
Assuming PostDate is a field of type datetime Try this before calling SQLFORM db.QuarterMaster.PostDate.default = request.now If PostDate is a field of type date use db.QuarterMaster.PostDate.default = request.now.date() and remove all the form.vars.PostDate assignments -- Resources: - http:

[web2py] Form field defaults the second time through

2017-01-19 Thread Dave S
I have a straight-forward controller function for entering the primary data: def index(): """ """ response.flash = T("Hello World") form = SQLFORM(db.QuarterMaster) form.vars.PostDate = str(request.now.year) + "-" + str(request.now.month ) + "-" + str(request.now.day) if f

[web2py] Form field manipulation questions

2017-01-03 Thread Dave S
I have an SQLFORM where I wanted the value of field 3 to depend on the value of field 2, sort of like cascading autocompletes, but not quite. Field 3 was going to be populated with the length of the string in Field 2, so I tried adding to my view jQuery(document).ready(function(){ jQuery('

[web2py] Form Field

2013-06-24 Thread Tom Russell
I have a form and I load a pre existing value that I generate internally before I call the form. What I want to see on the form is the value shown up but just as plain text so the user cannot modify it. If I do readable-False then it just shows None for the value rather than the value. How would I

[web2py] form field that reference to another table

2013-01-30 Thread 黄祥
hi, is it possible to add custom form field that reference to another table? i've tried both form, sqlform, sqlform.factory and crud it seems that it can't handle it or maybe there is something i missed. my goal is to show only id in the form sale header which is refer to customer table and whe

[web2py] Form field deactivate

2012-05-22 Thread max
I have a table with two fields. EN | SP Hello | Hola I | Yo Both the fields A and B represent the same vale in two languages. I want in a drop-down field , the Spanish value automatically selected, when english value is set to a specific word. It should also work , if I set the spanish wor

[web2py] FORM Field change keyboary reaction type

2011-06-19 Thread max
Is there any way to change the behaviour of the field in web2py. I want to use the ente rkey in the number side of the keyboard for jumping into the next field. looks like there is something similar in the multiple value columns.