What about using the keepvalues option:
>From the book:
form.accepts(vars, session=None, formname='default',
keepvalues=False, onvalidation=None,
dbio=True, hideerror=False):
Change keepvalues to True
Regards
Johann
On 24 April 2013 18:23, Niphlod <[email protected]> wrote:
> I think you need to be more clear...either you want to:
> - add a new record --> if you want to "preload" default values you just
> have to set them beforehand
> - edit an existing record --> it's obvious that what you edit (and submit)
> has the same value of the next attempt to edit the same record
>
>
> On Wednesday, April 24, 2013 6:00:11 PM UTC+2, software.ted wrote:
>
>> yah that exactly, but when you add a new record, the saved record does
>> not show in the form. I want the fields to remain with saved content. Even
>> when i use the example u have given....but when i click on a button with an
>> id with an existing record in the db it shows without any problem...when i
>> make changes the record remains in the fields.
>>
>>
>> On Wed, Apr 24, 2013 at 5:51 PM, Niphlod <[email protected]> wrote:
>>
>>> you mean an edit form ?
>>> record = db.table(1)
>>> form = SQLFORM(db.table, record)
>>>
>>>
>>>
>>> On Wednesday, April 24, 2013 5:35:18 PM UTC+2, software.ted wrote:
>>>>
>>>> Is there a way to make the form generated by SQLFORM return the current
>>>> fields saved in the DB instead of making the fields blank? What i want is
>>>> to return the record.
>>>>
>>>> --
>>>> ..............................****..............................****
>>>> ...........................
>>>> Teddy Lubasi Nyambe
>>>> Opensource Zambia
>>>> Lusaka, ZAMBIA
>>>>
>>>> Cell: +260 97 7760473
>>>> website: http://www.opensource.org.zm
>>>>
>>>> ~/
>>>> Human Knowledge belongs to the world! - AntiTrust
>>>>
>>>> Man is a tool-using animal. Without tools he is nothing, with tools he
>>>> is all - Thomas Carlyle 1795-1881
>>>>
>>>> /~
>>>>
>>> --
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+un...@**googlegroups.com.
>>>
>>> For more options, visit
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>
>>
>>
>> --
>> ..............................**..............................**
>> ...........................
>> Teddy Lubasi Nyambe
>> Opensource Zambia
>> Lusaka, ZAMBIA
>>
>> Cell: +260 97 7760473
>> website: http://www.opensource.org.zm
>>
>> ~/
>> Human Knowledge belongs to the world! - AntiTrust
>>
>> Man is a tool-using animal. Without tools he is nothing, with tools he is
>> all - Thomas Carlyle 1795-1881
>>
>> /~
>>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
Because experiencing your loyal love is better than life itself,
my lips will praise you. (Psalm 63:3)
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.