We help IT Professionals succeed at work.
Get Started

disable textbox

jagguy
jagguy asked
on
195 Views
Last Modified: 2015-03-01
Hi,
 
In cakephp I want to be able select a date only if I chose 'custom date' from drop down box.
If custom date is not selected I want the texboxes not able to receive input.

I think Ajax is needed but I can do it.

Currently the date can be selected anytime .

    $dateRange=array(0 => 'Fortnightly',1 => 'Today',2=> 'Month', 3 => 'Custom Date');
       

 echo $this->Form->input('dateRange', array('label' => 'Date Range',
                      'options' => $dateRange,'style'=>'width:150px','selected' => $dateSelect));
     

  //select date
    echo $this->Form->input('startDate',array('label' => 'Start Date','class'=>'datepicker', 'type'=>'text','style'=>'width:100px;height:30px','value' => $datestart));
Comment
Watch Question
IT Expert
CERTIFIED EXPERT
Top Expert 2009
Commented:
This problem has been solved!
Unlock 1 Answer and 18 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE