Update: I think I found a web2py bug.

form.custom.inpval.filename is generating bad html code. The first
option label of the html is this:
<select>
<option value="<option><option value=""></option><option
value="Joker">Joker</option><option value="Riddler">Riddler</
option><option value="Twoface">Twoface</option>">
<option value="Joker">Joker</option>
<option value="Riddler">Riddler</option
><option value="Twoface">Twoface</option></option>
</select>

Basically the first <option> has nested inside itself what should be
the actual <option> code. If I remove this in Firebug, the form
submits. Am I using form.custom.inpval wrongly? Or is this a bug?


On Jan 27, 9:58 am, Adi <aditya.sa...@gmail.com> wrote:
> Hi Denes/Massimo,
>
> Any inputs?
>
> On Jan 25, 8:20 pm, Adi <aditya.sa...@gmail.com> wrote:
>
>
>
> > Sorry I was posting the other reply so missed this: Responses inline.
>
> > > You are appending to form1 so check:
> > > 1) An INPUT named 'name', is it the only 'name' field in form1?
>
> > Yes. names of all fields are different.
>
> > > 2) Same for the SELECT, is there another 'gender' field?
>
> > No. All fields are different.
>
> > > 3) A second button named 'Add another' which will submit to the
> > > controller that generated form1 (self-submission), is that what you
> > > want?.
>
> > A button in the same row as the insertedformwhich says "Add another"
> > & submits the data to the same controller and function. So, Yes.
>
> > > Denes.
>
> > On Jan 25, 8:15 pm, DenesL <denes1...@yahoo.ca> wrote:
>
> > > On Jan 25, 6:35 am, Adi <aditya.sa...@gmail.com> wrote:
>
> > > > Hi all,
>
> > > > I'm trying to build acustomformin 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 theformas I want, i.e., parent read-
> > > > only record in aform, with additional single row of updateable child
> > > >formwith "Add another" button. The secondformis 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