[Seaside] [Bootstrap] Hidden input messing with checkbox

Mariano Martinez Peck marianopeck at gmail.com
Fri Nov 4 13:53:36 UTC 2016


On Fri, Nov 4, 2016 at 6:07 AM, Cyril Ferlicot D. <cyril.ferlicot at gmail.com>
wrote:

> On 04/11/2016 04:47, Mariano Martinez Peck wrote:
> > Hi Cyril,
> >
> > It would be nice if you can paste your seaside render code besides the
> > resulting html.
> >
> > Cheers,
> >
>
>
> Hi!
>
> This is the code I used:
>
> self orderedAnswers
>   do: [ :answer |
>     html div
>     class: #checkbox;
>     with: [ html checkbox
>       id: html nextId;
>       value: (aComponent resultFor: answer);
>       callback: [ :isChecked | aComponent at: answer put: isChecked ].
>       html label
>       for: html lastId;
>       with: answer text ] ]
>


The above code looks correct to me. I don't see anything strange.
And I never saw the issue you describe that you cannot click a checkbox
(and yes, I use bootstrap too).

When you click on the checkbox, nothing happens at JS side or at server
side? Is the callback executed?

The surrounding div with class 'checkbox' seems a bit strange, but I don't
see anything else :(

Cheers,


> And this is the result:
>
> <div class="checkbox">
>   <input id="id35" name="36" type="checkbox">
>   <input name="37" type="hidden">
>   <label for="id35"> rutrum feugiat</label>
> </div>
>
>
> Yesterday I found a hack to make it work but I would like something
> cleaner:
>
> html document addLoadScript: (JSStream on:
> '$(".checkbox").each(function(i,e){$(e).children("input[
> type=hidden]").prependTo(e)})')
>
> One problem with that is that I need to think to call it when I use Ajax.
>
> --
> Cyril Ferlicot
>
> http://www.synectique.eu
>
> 2 rue Jacques Prévert 01,
> 59650 Villeneuve d'ascq France
>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>


-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/seaside/attachments/20161104/93728da1/attachment.html>


More information about the seaside mailing list