Hi Furqan,

it´s much easier to create a new topic then use somebody elses topic to ask a new question. You´ll probably even get faster answers.

I´m not 100% sure I understand your question, but is it so that you want to have two or more forms on one page? If so please read:
http://web2py.com/book/default/chapter/07?search=is_in_db#Multiple-forms-per-page

it´s quite simple, just add formname='a unique name for each form' to form.accepts


Kenneth

Just a conceptual question for forms, sorry Kenneth that I am asking further question instead of trying to answer your question. I am newbie as well. Lets say we have 2 functions that create forms on two different view pages or same page and in controller we have 2 functions returning form dictionary. how would web2py determines which form goes where? I am sorry for stupid questiona

2011/7/27 Kenneth Lundström <[email protected] <mailto:[email protected]>>

    I have this controller function (simplified to make it easier to
    read):

    def testing():
       statuses =
    db(db.t_status.f_company==1).select(orderby=db.t_status.f_status)
       form = SQLFORM(db.t_ticket)
       form.vars.f_status = statuses[0].id
       if form.accepts(request.vars, session):
           response.flash = ('New ticket created')
       return dict(form=form)

    When the form is shown Status dropdown is selected with the first
    value from db.t_status table.

    When I fill out the form and submit it stores all values and a
    empty form is shown. But the Status dropdown is not selected. If I
    reload the page the value is shown in Status.

    Any ideas whats wrong?


    Kenneth




--
*-Furqan Rauf*
**Do you love your creator? Love your fellow-beings first. -Prophet Muhammad*
*
*http://www.amway.com/furqanrauf*


Reply via email to