[Twisted-web] multiple choice select box
Alberto Trujillo
alberto.trujillo at ucd.ie
Mon Aug 8 08:10:29 MDT 2005
Hello:
I have found a problem with the multiple selection in the select box
component. I only can receive the last item that I has choosen.
I'm working with html templates plus the nevow files, and I don't know
how to received all the selection that I have clicked in my form. Here
there is a part of my code. Can anybody help me?
Thank.
user.html
----------------
<select multiple="true" name="groups" size="8"
nevow:data="selectgroups" nevow:render="sequence">
<option nevow:pattern="item"
nevow:render="selectgroups">
<nevow:attr name="value"><nevow:slot
name="value" /></nevow:attr>
<nevow:slot name="label">select...</nevow:slot>
</option>
</select>
user.py
-------------
def executeAddUser(self, ctx):
"""Execute the process for add a new user"""
session = ctx.locate(inevow.ISession)
login = ctx.arg('login')
passwd = ctx.arg('passwd')
firstname = ctx.arg('firstname')
lastname = ctx.arg('lastname')
email = ctx.arg('email')
groups = ctx.arg('groups')
print "Groups" + str(groups)
if session.da.addUser(login, passwd, firstname, lastname, email,
groups):
session.msg = 'User add succefully!'
session.prevurl = 'ugp'
else:
session.msg = "Error adding user!"
session.prevurl = 'userdetails'
return 'displaymsg'
More information about the Twisted-web
mailing list