making a read-only checkbox

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

making a read-only checkbox

Gilles Schtickzelle
Hello,

I have a form with a bunch of checkboxes. I want some of them to be disabled depending on wether some other are checked or not.
I just can't figure out how to make a read-only checkbox (so that it would still show but would be greyed out). Is there such a thing in seaside (optimally with jquery so they can be updated on the fly when the user check/uncheck a box).

Thanks,
Gilles

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: making a read-only checkbox

Nick
Hi Giles,

I have a form with a bunch of checkboxes. I want some of them to be disabled depending on wether some other are checked or not.
I just can't figure out how to make a read-only checkbox (so that it would still show but would be greyed out).

Try:

html checkbox
value: true;
disabled: true;
with: 'a disabled checkbox'


#disabled: works for all form elements.


 
Is there such a thing in seaside (optimally with jquery so they can be updated on the fly when the user check/uncheck a box).

html checkbox
id: #myDisabledCheckbox;
value: true;
disabled: true;
with: 'a disabled checkbox'.
html checkbox
value: true;
onClick: ((html jQuery: #myDisabledCheckbox) attributeAt: 'checked' put: (html jQuery this attributeAt: 'checked'));
with: 'mirror the other checkbox'


To put this example together I Googled 'jQuery checkbox' - found http://www.electrictoolbox.com/check-uncheck-checkbox-jquery/ then translated the result into Seaside jQuery.

Hope this helps

Nick
 

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: making a read-only checkbox

Gilles Schtickzelle
Ah yes thank you!

I had tried to add a 'disabled: true' but apparently I put it at the wrong place and it wasn't working.
Now it's all good thanks.

On Mon, Nov 15, 2010 at 11:51 AM, Nick Ager <[hidden email]> wrote:
Hi Giles,

I have a form with a bunch of checkboxes. I want some of them to be disabled depending on wether some other are checked or not.
I just can't figure out how to make a read-only checkbox (so that it would still show but would be greyed out).

Try:

html checkbox
value: true;
disabled: true;
with: 'a disabled checkbox'


#disabled: works for all form elements.


 
Is there such a thing in seaside (optimally with jquery so they can be updated on the fly when the user check/uncheck a box).

html checkbox
id: #myDisabledCheckbox;
value: true;
disabled: true;
with: 'a disabled checkbox'.
html checkbox
value: true;
onClick: ((html jQuery: #myDisabledCheckbox) attributeAt: 'checked' put: (html jQuery this attributeAt: 'checked'));
with: 'mirror the other checkbox'


To put this example together I Googled 'jQuery checkbox' - found http://www.electrictoolbox.com/check-uncheck-checkbox-jquery/ then translated the result into Seaside jQuery.

Hope this helps

Nick
 

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: making a read-only checkbox

Diogenes Moreira
Here the net, not only the fish...
The next when you need knows a property in a seaside object, take a
look to WAHtmlCanvas and WARenderCanvas, in that objects methods
seaside builds the htmls components. In your case, in your case the
object whon represent to checkbox is WACheckboxTag.
Otherwise, if the standars object don't have the properties/messages
(that is very extrange, but may be happend) that you need, you can use
message attributesAt:put: to set an other properties

Best Regards

2010/11/15, Gilles Schtickzelle <[hidden email]>:

> Ah yes thank you!
>
> I had tried to add a 'disabled: true' but apparently I put it at the wrong
> place and it wasn't working.
> Now it's all good thanks.
>
> On Mon, Nov 15, 2010 at 11:51 AM, Nick Ager <[hidden email]> wrote:
>
>> Hi Giles,
>>
>> I have a form with a bunch of checkboxes. I want some of them to be
>>> disabled depending on wether some other are checked or not.
>>> I just can't figure out how to make a read-only checkbox (so that it
>>> would
>>> still show but would be greyed out).
>>
>>
>> Try:
>>
>> html checkbox
>>  value: true;
>> disabled: true;
>> with: 'a disabled checkbox'
>>
>>
>> #disabled: works for all form elements.
>>
>>
>>
>>
>>> Is there such a thing in seaside (optimally with jquery so they can be
>>> updated on the fly when the user check/uncheck a box).
>>>
>>
>> html checkbox
>>  id: #myDisabledCheckbox;
>> value: true;
>> disabled: true;
>>  with: 'a disabled checkbox'.
>>  html checkbox
>>  value: true;
>> onClick: ((html jQuery: #myDisabledCheckbox) attributeAt: 'checked' put:
>> (html jQuery this attributeAt: 'checked'));
>>  with: 'mirror the other checkbox'
>>
>>
>> To put this example together I Googled 'jQuery checkbox' - found
>> http://www.electrictoolbox.com/check-uncheck-checkbox-jquery/ then
>> translated the result into Seaside jQuery.
>>
>> Hope this helps
>>
>> Nick
>>
>>
>> _______________________________________________
>> seaside mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>>
>

--
Enviado desde mi dispositivo móvil
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside