This is a rudimentary example but it should get you started: def formtest(): form = SQLFORM.factory(Field('first'),Field('second')) submitrow = form.element(_type='submit').parent newrow = TR(LABEL('third'),INPUT(_type='text',_name='third')) addfields = INPUT(_type='button',_value='Add Fields', _onclick="jQuery('form table').append('%s')" % XML(newrow)) submitrow.append(addfields) return dict(form=form)
On Jul 20, 12:30 pm, ellimistd <ellimi...@gmail.com> wrote: > Is there a way I can use javascript/web2py to make a self submitting > form that has some required fields, but also has a button, that, when > clicked, adds another field? Actually, I need it to add two fields, > in a way that works as a dictionary = one form's content acts as the > way to call the other from the object, once submitted. These could be > stored simply as data in the row, or preferably all of them would be > stored as a single sub-dictionary. > > Is there any built-in way I can do this?