Is there any way I can iterate through a form? I want to construct a
form, with two elements in a row instead of one, and use CSS instead
of table.
I know there is form.custom, but there I have to give the form element
names explicitly. I want a generic solution for all forms I construct.
Also in form.components, the form opening and closing is not part of
it, (I guess).
Thanks
Vihang
for e in form.components[0]:
print e[0][0] # labels
print e[1][0] # non-labels
Denes
form[0] is the table in the form
form[0][i] is the i-th row
form[0][i][1] is the 2nd column of the i-th row
form[0][i][1][0] is the INPUT inside that
form[0]['_class'] is the class attribute of the table
form[0][i][1][0]['_name'] is the name attribute of the INPUT
form.element(_name='email')['_class'] is the class attribute of the
element with attribute name=='email'
etc.
You can manipulate and change the form structure and form attributes
in this was any way you want.