Re: [Bootstrap] Hidden input messing with checkbox
"Cyril Ferlicot D." <[email protected]>
| Newsgroups | gmane.comp.lang.smalltalk.squeak.seaside |
|---|---|
| Message-ID | <[email protected]> |
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 ] ]
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
signature.asc
(application/pgp-signature, 801 B)
-----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJYHE/VAAoJEBzpUtxBqUIDb7sP/RZIsjSlUtpOHCEJPzfDLqVo g5J6rYQZoWilG58sy4hOFD4NnCDmUDlb/WiaAeSXj3PQyaYyRZsmpL8x8jglIScN HjC8sWL86QUdOXGWOQAiPXJ3SPOl5YFHh8ts4klhLj6UkQFST6JuM7BYr6uANzEZ SlQEBA+ylb93xooD8hMUOon8ioA4xQVWAQg8xjcr2Sg6xCCcycb09b07JZe0h1zB zKIfxJ4wbPjiiVeGreu6s58AHwcsGfcaakDJGRgfSZiJV93k7ZaFZPRUISV5As/d 62kaLPY25T/YSIpKgrwYFV7D2HiR4s6Di1q4zJw7BEESDio45X1WK1qbCAgC8FlB 6WnbhcaDa36p7sD8L5yhDkkv8QArk+agN1lRTU3Rn1A4bqruHwD1tA1F+2PXWFhD il3vrXUSOMFcxo5aibYotuDDyXCMFqs6X72k71J4rp6dEVasyw3Brj6jwBvH327k r1UBDpnwcVQSIbL1T/xBKsfRxoCuZCIrGw4xiTF9TcsI6hEt7fjx3BisvkAyOpWc 8nH/oee2N1z97O9skM3CpXfF8FA9CXRIKj5lKjDruTN7g5W/efniAQowoiDpu/9x YbMFU7Hv/K3Lj4HkHu9TsgjZ73fkwq9iXiC5ovS8eUjbmEsU5RUCYCWAZZKiF5La NATYQhNgkQwKXI9NgH2F =fYtV -----END PGP SIGNATURE-----