form = SQLFORM(db.table)
myinput = INPUT(_type='text',_name='testing',_value='blablabla')
form.append(myinput)

Example in shell:

>>> a = SQLFORM(db.category)
>>> a
<gluon.sqlhtml.SQLFORM object at 0x101c42d50>
>>> print a
<form action="" enctype="multipart/form-data" method="post"><table><tr
id="category_name__row"><td class="w2p_fl"><label for="category_name"
id="category_name__label">Name: </label></td><td class="w2p_fw"><input
class="string" id="category_name" name="name" type="text" value=""
/></td><td class="w2p_fc"></td></tr><tr id="submit_record__row"><td
class="w2p_fl"></td><td class="w2p_fw"><input type="submit" value="Submit"
/></td><td class="w2p_fc"></td></tr></table></form>
>>> a.append(INPUT(_type='text',_name='testing'))
>>> a
<gluon.sqlhtml.SQLFORM object at 0x101c42d50>
>>> print a
<form action="" enctype="multipart/form-data" method="post"><table><tr
id="category_name__row"><td class="w2p_fl"><label for="category_name"
id="category_name__label">Name: </label></td><td class="w2p_fw"><input
class="string" id="category_name" name="name" type="text" value=""
/></td><td class="w2p_fc"></td></tr><tr id="submit_record__row"><td
class="w2p_fl"></td><td class="w2p_fw"><input type="submit" value="Submit"
/></td><td class="w2p_fc"></td></tr></table><input name="testing"
type="text" /></form>
>>>


2010/12/13 Carlos <carlosgali...@gmail.com>

> Hi weheh,
>
> Yes, I've looked at virtual and computed fields, but I believe (not
> sure) they do not provide the behavior I require.
>
> I need a non-persistent field/widget (e.g. checkboxes) in a regular
> persistent SQLFORM, such that the flow after the submit will depend on
> these non-persistent values. For reference having one checkbox in the
> SQLFORM that says "I want to proceed to X step after submit".
>
> I'm not sure if I'm explaining well?.
>
> Thanks,
>
>   Carlos
>
>
> On Dec 12, 9:33 pm, weheh <richard_gor...@verizon.net> wrote:
> > Have you looked at virtual fields and computed fields?
> >
> > On Dec 12, 6:54 pm, Carlos <carlosgali...@gmail.com> wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Hi,
> >
> > > Is it possible to define extra non-persistent fields in forms, either
> > > by CRUD or SQLFORM?.
> >
> > > Or is SQLFORM.factory the only option?.
> >
> > > Thanks,
> >
> > >    Carlos
>



-- 

Bruno Rocha
http://about.me/rochacbruno/bio

Reply via email to