>
> Do you want to add a radio input disabled or disable some option based on
> some data?
>
Yes, I do want to "disabled" some radio buttons. But, what if the "options"
is under an array?
EX:
$ccbanks = array(
"VISA" => "VISA",
"MasterCard" => "MasterCard",
"AMEX" => "AMEX");
<?php
echo $form->input('Shipping.
shipping_mode', array(
//'div' => false,
'class' => 'sepradio',
//'label' => false,
'legend' => false,
'type' => 'radio',
'options' => $ccbanks));
?>
If I add 'DISABLED' => 'DISABLED', or 'DISABLED' => 1,. It would disable all
the array and not just a single value. *How can I disable only a single
value within an array?*
And thank you for replying and giving me some tips. :)
--
Louie Miranda
- Email: [email protected]
- Web: http://www.louiemiranda.com
On Tue, Nov 9, 2010 at 8:46 AM, Renato de Freitas Freire <[email protected]
> wrote:
> Do you want to add a radio input disabled or disable some option based on
> some data?
>
> if is the first option:
> <?php
> echo $form->input('Shipping.shipping_mode', array(
> //'div' => false,
> 'class' => 'sepradio',
> //'label' => false,
> 'legend' => false,
> 'type' => 'radio',
> 'DISABLED' => 'DISABLED',
> 'options' => $shippingmodes));
> ?>
>
>
> The second option you can do it with jquery.
> Maybe something like this (I suck on jquery, u may need to change
> something):
>
> <?php
> echo $form->input('Shipping.shipping_mode', array(
> //'div' => false,
> 'class' => 'sepradio',
> //'label' => false,
> 'legend' => false,
> 'type' => 'radio',
> 'id' => 'myradio'
> 'options' => $shippingmodes));
> ?>
>
> $('#myradio').click(function() {
> var value = $(this).val();
> if(value=='SOME_VALUE')
> $('#some_form_field_id').attr('disabled',true);
> });
>
> I really dont know what u want, but hope this help you.
>
> --
> Renato de Freitas Freire
> [email protected]
>
>
> On Mon, Nov 8, 2010 at 10:26 PM, Louie Miranda <[email protected]> wrote:
>
>> I think, this is not possible? I do not want to use $form->radio()
>>
>> --
>> Louie Miranda
>> - Email: [email protected]
>> - Web: http://www.louiemiranda.com
>>
>>
>>
>> On Mon, Nov 8, 2010 at 3:51 PM, Louie Miranda <[email protected]> wrote:
>>
>>> I have this array...
>>>
>>> $ccbanks = array(
>>> "VISA" => "VISA",
>>> "MasterCard" => "MasterCard",
>>> "AMEX" => "AMEX");
>>>
>>> And my view...
>>>
>>> <?php
>>> echo $form->input('Shipping.shipping_mode', array(
>>> //'div' => false,
>>> 'class' => 'sepradio',
>>> //'label' => false,
>>> 'legend' => false,
>>> 'type' => 'radio',
>>> 'options' => $shippingmodes));
>>> ?>
>>>
>>> I am wondering how can I add a "DISABLED" text for each array input?
>>>
>>> --
>>> Louie Miranda
>>> - Email: [email protected]
>>> - Web: http://www.louiemiranda.com
>>>
>>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]<cake-php%[email protected]>For
>> more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
> Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<cake-php%[email protected]>For
> more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en