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 cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.