title: display textbox when item is selected from dropdown list html php?
body: <pre><code> &lt;div class="control-group"&gt;
                &lt;label class="control-label"&gt;
                  &lt;span class="red"&gt;*&lt;/span&gt;Camera name&lt;/label&gt;
                &lt;div class="controls"&gt;
                  &lt;select name="cam_name" class="span3" id = "ddlPassport" onchange = "ShowHideDiv()"&gt;
                    &lt;option&gt;Select camera:&lt;/option&gt;
                    &lt;option&gt;canon&lt;/option&gt;
                    &lt;option&gt;nicon&lt;/option&gt;
                    &lt;option&gt;sony&lt;/option&gt;
                    &lt;option&gt;pentex&lt;/option&gt;
                    &lt;option&gt;olympus&lt;/option&gt;
                    &lt;option&gt;others&lt;/option&gt;
                  &lt;/select&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="control-group" id="dvPassport" style="display: none"&gt;
                &lt;label class="control-label"&gt;Your camera name:&lt;/label&gt;
                &lt;div class="controls"&gt;
                  &lt;input type="text" placeholder="Enter model" name="cam_name" class="input-xlarge"&gt;
                &lt;/div&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p>javascript</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function ShowHideDiv() {
      var ddlPassport = document.getElementById("ddlPassport");
      var dvPassport = document.getElementById("dvPassport");
      dvPassport.style.display = ddlPassport.value == "others" ? "block" : "none";
  }
  </code></pre>
  
  <p></p>
  
  <p>php code</p>
  
  <pre><code>$camname = $_POST['cam_name'];// user name
  if(empty($camname)){
  
        $errMSG = "Please enter camera name";
  
      }
  </code></pre>
  
  <p>When i select "others" from dropdown list...it works fine
  but the problem is when i select canon or nicon else...the hidden div's input tag gives error..in php code when cheking with if(empty($camname));</p>