Re: [Bootstrap] Hidden input messing with checkbox

Mariano Martinez Peck <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.squeak.seaside
Message-ID <CAA+-=mUpuiTmaYgcDZwG9kT8n4S_BNT9cZLR-f_qhP987QqUZg@mail.gmail.com>
On Fri, Nov 4, 2016 at 6:07 AM, Cyril Ferlicot D. <[email protected]>
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
> [email protected]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>


-- 
Mariano
http://marianopeck.wordpress.com

_______________________________________________
seaside mailing list
[email protected]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.