The onChange event is happening in the browser, so is not really related to 
CakePHP.

Please show the how code for the page, when it has been rendered in the 
browser. This may help us and you to understand what may have gone wrong 
with your code.

Enjoy, John

On Friday, 27 February 2015 16:06:54 UTC+2, ajt wrote:
>
> Hi, I cant get any onchange event to fire. I just want to disable a 
> textbox when some  options are selected.
>
> I used id  and name in textbox but I cant get thus to work as when i click 
> the radio button nothing changes.
> I used radio buttons 
>
>
> echo $this->Form->input('startDate',array('id'=>'startdatebox','label' => 
> 'Start Date','class'=>'datepicker', 
> 'type'=>'text','style'=>'width:100px;height:30px','value' => $datestart));
>          echo '</td>';
>              echo '<td>';
>           echo $this->Form->input('endDate',array('id'=>'enddatebox','label' 
> => 'End Date','class'=>'datepicker', 
> 'type'=>'text','style'=>'width:100px;height:30px','value' => $dateend));
>              echo '</td>';    
>        
>   echo $this -> Form -> input('dateRange', 
>                array('id'=>'dateRange','label' => '<h6>Date 
> Range</h6>','type' => 'radio', 'value' =>$dateSelect,'options' =>  
> $selectoption));
>      
>
> <script type="text/javascript">  
> $(document).ready(function() {
>     $('#dateRange').change(function() {
>         if ( $(this:'checked').val() != 3 )
>         {
>             $('#startdatebox]').prop('disabled', true);
>             $('#enddatebox]').prop('disabled', true);
>             alert('asdsad');
>             
>         }
>         else
>         {
>             $('#startdatebox]').prop('disabled', false);
>             $('#enddatebox]').prop('disabled', false);
>              alert('asdsad');
>         }
>     });
> });
> </script>
>                     
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Reply via email to