Thanks Anthony. But as I stated above, the problem is the <div> element which contains the _formname and _formkey is not getting generated on the page for the image upload form and I think that it might be creating the problem.
What can be the reason for it ? On Monday, April 2, 2012 6:29:41 PM UTC+5:30, Anthony wrote: > > I tried with form.validate() and also with form.process().accepted. Can >> you provide some sample code on how do I achieve the above ? >> I am already providing the name of the form while declaring it. How is it >> different from web2py generated _formname ? >> > > Your original code simply set the "name" attribute of the HTML <form> > element (i.e., SQLFORM(..., _name=...)). However, that doesn't affect the > _formname hidden element. To set that, you have to set the "formname" > argument to the accepts() method (or process() or validate()). Anyway, > I'm not sure you need to set your own formname -- web2py will automatically > generate a formname based on the db table name and type of form, so two > forms on the same page based on different tables will have different names > anyway. See > http://web2py.com/books/default/chapter/29/7#Multiple-forms-per-page. > > Anthony >