Hello Comunity!!!
I found the next link
http://www.web2pyslices.com/slice/show/1370/modify-form-elements-and-attributes,
so I can load the images in this way:
strings = form.elements(_id='loadfoto1')
for s in strings:
s['_src'] = URL('default','download', args=item.foto1)
Best regards.
El viernes, 29 de enero de 2016, 20:39:28 (UTC-3), isi_jca escribió:
>
> Hi!!!
>
> I have a form created using Helper HTML, It is has manye field
>
> form = FORM(TABLE(
>
> TR(TD(LABEL("Foto 1:",_class="label_foto5"),
> INPUT(_class="upload",_id="foto5",_name="foto5", _type="file",
>
> _onchange="leerarchivobin('foto5','loadfoto5')")),
> TD(LABEL("Foto
> 2:",_class="label_foto6"),INPUT(_class="upload",_id="foto6",_name="foto6",
> _type="file",
>
> _onchange="leerarchivobin('foto6','loadfoto6')")),
> TD(LABEL("Foto
> 3:",_class="label_foto7"),INPUT(_class="upload",_id="foto7",_name="foto7",
> _type="file",
>
> _onchange="leerarchivobin('foto7','loadfoto7')")),
> TD(LABEL("Foto
> 4:",_class="label_foto8"),INPUT(_class="upload",_id="foto8",_name="foto8",
> _type="file",
>
> _onchange="leerarchivobin('foto8','loadfoto8')")),),
>
> TR(TD(IMG(_id="loadfoto5")),
> TD(IMG(_id="loadfoto6",_height="300px")),
> TD(IMG(_id="loadfoto7")),
> TD(IMG(_id="loadfoto8"))
> )))
>
>
> When I retrieve data from database I set data in the form this manner.
>
> form.vars.campo_1 = item.campo_1
> ....
> ....
> form.vars.campo_n = item.campo_n
>
> ¿How do I to set image in field type upload?. For example, in my table I
> have next definition:
>
> Field('foto1', 'upload',label=T('Foto 1 - Cliente'))
>
> Thanks in advance.
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.