title: how to show text box value for already selected item in dropdownlist using jquery
body: <p>i have a page name is edit_new_residancy.ctp here everthing is working but i am stucking a problem in that page i have a dropdown list housing allowance which accept cash or by company i want when cash option is already selected then automatacally a text box will be show with the value. code is blow here</p>
  
  <pre><code>&lt;?php if($company_type==LABOUR_TYPE) { ?&gt;
      &lt;div id="salary_detail_section"&gt;
        &lt;div class="row"&gt;
            &lt;div class="col-md-12"&gt; &lt;h4&gt;Salary Detail:&lt;/h4&gt; &lt;/div&gt;
        &lt;/div&gt;
  
        &lt;div class="row"&gt;
           &lt;div class="col-md-6"&gt;
              &lt;div class="form-group"&gt;
               &lt;?php echo $this-&gt;Form-
                 &gt;input('basic_salary',array('required'=&gt;false,'class'=&gt;"form-
                 control",  'placeholder'=&gt;"Basic Salary","label"=&gt;false)); 
               ?&gt;
              &lt;/div&gt;
             &lt;/div&gt;
  
          &lt;div class="col-md-6"&gt;
             &lt;div class="form-group"&gt;
              &lt;?php echo $this-&gt;Form-&gt;input('housing_allowance_type',
                  array('required'=&gt;false,'class'=&gt;"form-control",
                 'id'=&gt;"ApplicationAllowanceType",'type'=&gt;"select",
                 'options'=&gt;$housing_allowance_type,"label"=&gt;false)); 
               ?&gt;
             &lt;/div&gt;
           &lt;/div&gt;
  
         &lt;div class="col-md-6" id="cash_box" style="display:none;"&gt;
            &lt;div class="form-group"&gt; 
               &lt;?php echo $this-&gt;Form-&gt;input('housing_allowance',
                     array('required'=&gt;false,'class'=&gt;"form-control",
                     "label"=&gt;false,'placeholder'=&gt;"Enter amount",
                     'id'=&gt;'house_allowance')); 
               ?&gt;
            &lt;/div&gt;
         &lt;/div&gt;
  
         &lt;/div&gt;
         &lt;/div&gt; 
         &lt;?php } ?&gt;
  </code></pre>
  
  <p>my jquery code in same file which is blow here.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;  
      $(document).ready(function(){
      $('#ApplicationAllowanceType').change(function(){
          $type = $(this).val();
          if($type==2)
          {
              $('#cash_box').show('slow');
          }else{
              $('#cash_box').hide('slow');
          }
      });
    });
  
  
   &lt;/script&gt;
  </code></pre>
  
  <p>i am getting correct value in dropdownlist which is cash($type==2) but i am not getting text box(#cash_box) automatacally.a very thanks in advance.</p>