If you want to submit a list of inputs to FORM(), then that's all you can 
submit. So, append the submit input to the fields list and then just do 
FORM(fields).

Also, if db.a_table.image is an upload field, it will just store the 
transformed filename, which won't be very informative to the users. You'll 
probably want to show the original filename (it may be easiest to store 
that in a separate field rather than extract it from the transformed 
filename).

Anthony

On Tuesday, January 14, 2014 4:44:49 PM UTC-5, Chris Hepworth wrote:
>
> I am trying to make a custom form which allows the selection of a set of 
> images that are in the database. So far I have the following code:
>
> rows = db().select(db.a_table.name,db.a_table.image)
>     fields = []
>     for row in rows:
>         fields += [
>         INPUT(_type="checkbox", _value=row.image) , row.f_name
>         ]
>     form=FORM(fields,INPUT(_type='submit'))
>
> I know for sure that the database query is correct and is not a problem at 
> all now. However, when I insert the form into the view it appears as 
> follows:
>
> [<gluon.html.INPUT object at 0xaf12bc2c>, 'Koi', <gluon.html.INPUT objectat 
> 0xaf12bb8c>, 'Goldfish'...
>
> The only thing that renders as intended is the submit button. Am I going 
> about this problem the right way? And if not, is there a way to achieve the 
> effect I want? 
>

-- 
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/groups/opt_out.

Reply via email to