Am 29.10.2013 um 04:38 schrieb pip:
> Since you can't have hyphens in python variable names, how do we pass 
> attributes containing hyphens to a form?


There are some ways around it. For example, you can create an inline dict and 
pass that as kwargs:

form.Textbox("username", form.regexp("^[A-Za-z0-9]*$", 'Username must contain 
only letters and numbers'), description="Username", 
**{'data-attribute':'required'})

Alternatively you can pass arbitrary args in a second step:

t = form.Textbox("username", form.regexp("^[A-Za-z0-9]*$", 'Username must 
contain only letters and numbers'), description="Username")
t.attrs['data-attribute'] = 'required'


-Ole.


-- 
Ole Trenner
<[email protected]>




-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/webpy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to