Hi all,

This is my first question for the list; up to now i have been lurking and 
learning mainly. Not sure if this list is still active.
I think it is fair to say I am not an experienced python programmer so - 
this might just be my lack of knowledge. Forgive me please if my question 
shows just that.

I built a form that enables users to choose more than 1 row through a 
checkbox.
This form and the subsequent handling just works fine, as long as I choose 
more than 1 row.

As the piece of code from the view below shows - the value for the box is 
the ID of the table-record:
===
         {{for lijst in lijsten:}}
            <tr>
                <td>{{=lijst.methode.titel}}</td>
                <td>{{=lijst.woordenlijst.titel}}</td>
                <td 
style="width:100px">{{=lijst.woordenlijst.taal_links}}</td>
                <td 
style="width:100px">{{=lijst.woordenlijst.taal_rechts}}</td>
                <td><input type="checkbox" name="keuzelijst" 
value="{{=lijst.woordenlijst.id}}"/></td> !!!!! 
            </tr>
        {{pass}}
===

If I however choose just one row that has an ID say 38 --> than the 
following happens when dealing with the choices:

===
   if request.vars:
        for x in range(len(request.vars.keuzelijst)):
            
db.lijst_ovh.insert(gebruiker=auth.user_id,wlijst=request.vars.keuzelijst[x],overhoring=currentOvh)
===
First of all: the length of request.vars.keuzelijst appears to be 2 ??
The ID (38) is being split into 2 separate values: first loop  3 and the 
next loop 8

So what am I doing wrong here?

I hope you can help me with this 

Regards

Frank Claessen

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to