The ids are only used for CSS. you can do

form1=SQLFORM(...,_class='form1')
form1.accepts(request.post_vars,formname=None)
form2=SQLFORM(...,_class='form2')
form2.accepts(request.post_vars,formname=None)
return dict(form1=form1,form2=form2)

and you can use the class to refer to the id of the first or the
second in CSS. There should be no ambiguity.

Massimo


On Jan 27, 12:23 am, Jeremy Dillworth <jdillwo...@gmail.com> wrote:
> I'm building an app where I am likely to want multiple SQLFORMs on the
> same view.
>
> Reading the manual I can see how this works using the formname
> argument on the SQLFORM.accepts method.
>
> I'm a little concerned about the HTML side of things, though. I've
> noticed that the HTML generated by default contains lots ids that will
> be duplicates if you have multiple forms (e.g. <tr
> id="submit_record__row">).
>
>   I'll probably want to write custom forms in my own HTML in the long-
> run anyway, but it looks like a lot of these ids could be CSS classes
> and maybe save me some trouble in cases where the SQLFORM default HTML
> is otherwise 'good enough' (in fact I've been having some fun and have
> a short function using xml.dom.minidom.parseString to move the ids to
> the class attribute and it seems to work ok).
>
> Is there any reason why the ids are needed (other than CSS perhaps)?
>
> If not, any chance of a future version of web2py using these as
> classnames?
>
> Thanks in advance and thanks for a cool web framework,
>
> Jeremy

-- 
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