On Jan 25, 6:35 am, Adi <aditya.sa...@gmail.com> wrote:
> Hi all,
>
> I'm trying to build a custom form in this fashion:
>
> There's a parent table and a child table (many one relationship). I've
> created a read-only SQLFORM for a record of the parent, and then I'm
> trying this:
>
> form1 = SQLFORM(db.parent, readonly=True)
>
> form2 = SQLFORM(db.child, keepopts=['gender'])
>
> form1[0].append(TR(INPUT(_type='text', name='name',
> requires=IS_NOT_EMPTY()), \
> SELECT(form2.custom.inpval.gender, name='gender'),\
> INPUT(_type='submit', _value='Add another'))
>
> This gives me the appearance of the form as I want, i.e., parent read-
> only record in a form, with additional single row of updateable child
> form with "Add another" button. The second form is to provide a drop-
> down list for 'gender'. However, in this case the "Add another" button
> doesn't submit, i.e, I can't get control in form1.accepts or
> form2.accepts.
>
> What am I doing wrong?

You are appending to form1 so check:
1) An INPUT named 'name', is it the only 'name' field in form1?
2) Same for the SELECT, is there another 'gender' field?
3) A second button named 'Add another' which will submit to the
controller that generated form1 (self-submission), is that what you
want?.

Denes.


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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.

Reply via email to