You need to create a custom widget and then:

db.gallery.tag_id.widget = mycustomwidget

or use the web2py mult select widget that ships with plugin_wiki.

http://zerp.ly/rochacbruno
Em 14/04/2012 07:50, "villas" <villa...@gmail.com> escreveu:

> Hi All,  I have just spent a few frustrating hours with the jQuery
> Multi-Select widget:
> http://www.abeautifulsite.net/blog/2008/04/jquery-multiselect/
>
> For this field:
>   db.define_table('gallery', Field('tag_id','list:reference tag')
>
> it renders for example this HTML element:
>    <label class="checked">
>      <input type="checkbox" checked="checked" value="1"
>  name="gallery_tag_id[]">
>      MyTagName
>   </label>
>
> Note:  name="gallery_tag_id[]"   does not work (I mean does not save on
> submission).
>
> I need this instead:  name="tag_id"
>
> So, what to do?  For now I put this script into my form to fix it:
>
> <script>
>     $("form").submit(function() {
>       $("form input:checkbox").attr('name', 'tag_id');
>     });
> </script>
>
> However,  this is a a bit of a hack,  so someone might have a better idea?
>  I can't believe I'm the first to have the problem,  so I think I'm missing
> something...
>
> Regards,
> David
>

Reply via email to