title: How to fetch value from database using Jquery?
body: <pre><code>&lt;div  class="border padding10 margin-bottom2"&gt;
      &lt;label&gt;Institute Name&lt;/label&gt;
      &lt;div id="div-sec-qual-inst-id" class="input-control select" data-role="input-control"&gt;
          &lt;select id="sec-qual-inst-id" data-placeholder="Enter institute name" style="width:350px;" name="user.secHighQualInst" class="chosen-select" tabindex="-1"&gt;
              &lt;option value=""&gt;&lt;/option&gt;                                  
          &lt;/select&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>I want to display a text box when user selects 'others' in option from select box now my options are in database. I tried using this code</p>
  
  <pre><code> $(function () {
      $("#sec-qual-inst-id").change(function () {
          if ($(this).val() == "#Others") {
               $("#other-sec-qual-inst-id").show();
          } else {
               $("#other-sec-qual-inst-id").hide();
          }
      });
  });
  </code></pre>
  
  <p>but its not working i am using chosen.jquery.js. Do i need to change something in this?</p>
  
  <pre><code>    Handler.prototype.success = function(result, status, xhr){
          if(this.action == 'institutes'){
              institutes = result.campuses;
              $("#inst-id").append(getInstitutesHtml(institutes));            
              $("#inst-id").chosen();
          }else if(this.action == 'courses'){
              courses = result.courses;h
              $("#course-id").append(getCoursesHtml(courses));
              $("#course-id").chosen().change(function(that){
                  var course = $("#course-id").val();
                  var streams = {};
                  var options = '&lt;option value=""&gt;&lt;/option&gt;';
                  console.log(course);
                  streams = courses[course];
                  $.each(streams, function( index, value ) {
                      options = options+'&lt;option value="'+value+'"&gt;'+value+'&lt;/option&gt;'; 
                  });
                  $("#stream-id").html("");
                  $("#stream-id").append(options);    
                  if(flag){
                      $("#stream-id").chosen();
                      flag = false;
                  }else{
                      $("#stream-id").trigger("chosen:updated");
                  }
              });
          }else if(this.action == 'keyskills'){
              keyskills = result.keySkills;
              $("#keyskills-id").append(getKeyskillsHtml(keyskills));         
              $("#keyskills-id").chosen();
          }
  
  
      };
  </code></pre>