On 01/01/2010 11:09 PM, Anand Chitipothu wrote:
> On Sat, Jan 2, 2010 at 8:44 AM, pyther<[email protected]>  wrote:
>    
>> Hello.
>>
>> I am connecting to a database and storing information into a variable
>> which I then pass into my template. I would then like to use this
>> information to fill out the form with the values I got from the db
>> (using<input value="" />).
>>
>> A prototype of the form:
>>
>> edituser_form = form.Form(
>>      form.Textbox('username',
>> form.notnull,description="Username:",size='15'),
>>      form.Textbox('credits', form.notnull, form.regexp('\d+', 'Must be a
>> digit'), description="Upload Credits:",size='2'),
>>      form.Dropdown('month',
>>          [
>>              ('1', 'Janurary'),
>>              ('2', 'Feburary'),
>>              ('3', 'March'),
>>              ('4', 'April'),
>>              ('5', 'May'),
>>              ('6', 'June'),
>>              ('7', 'July'),
>>              ('8', 'August'),
>>              ('9', 'September'),
>>              ('10', 'October'),
>>              ('11', 'November'),
>>              ('12', 'Decemember')
>>          ],
>>          onclick="getDays()",
>>          description='Expiration Month:')
>>      ),
>>      form.Dropdown('day', [
>>              ('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9'),('10'),
>>
>> ('11'),('12'),('13'),('14'),('15'),('16'),('17'),('18'),('19'),('20'),
>>
>> ('21'),('22'),('23'),('24'),('25'),('26'),('27'),('28'),('29'),('30'),('31')
>>          ], description='Expiration Day:')
>>      ),
>>      form.Dropdown('year',
>> [str(datetime.now().year),str(datetime.now().year+1),str(datetime.now().year+2)],
>> description="Experation Year:", onclick="getDays()"),
>>      form.Dropdown('uType', ['user','admin'], description="User Type:"),
>>      validators = [
>>          form.Validator("Duplicate User.", checkDupUser)
>>      ]
>> )
>>
>> How would I go about adding value="$variable" to the form?
>>      
> Like this:
>
> form.fill({"username": "joe"})
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "web.py" 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 at 
> http://groups.google.com/group/webpy?hl=en.
>
>
>    
Thank you! That works great!

--

You received this message because you are subscribed to the Google Groups 
"web.py" 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 at 
http://groups.google.com/group/webpy?hl=en.


Reply via email to