I have 2 select box in html. First is for Country and second is for city. I need to show a textbox when user select country other then Pakistan and show a drop down list for city if user select Pakistan form country dropdown.
Here is my code which i tried:
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" method="post">
  <div class="form-group col-md-3">
    <label for="cc-payment" class="control-label mb-1">Birth Country</label>
    <select class="form-control" name="Birth_Country" id="Birth_Country" style="color:  black;" required>
      <option value="">Please Select Birth Country</option>
      <?php
      $sel_cus = "select Country_Name from personal_country_name Order By Country_Name";
      $res_cus = mysqli_query($connection, $sel_cus);
      while ($row = mysqli_fetch_array($res_cus)) {?>
      <option value="<?php echo $row['Country_Name'];?>"><?php echo strtoupper($row['Country_Name']);?></option>
      <?php
      }
      ?>
    </select>
  </div>
  <div class="form-group col-md-3">
    <label for="cc-payment" class="control-label mb-1">Birth City</label>
    <select class="  form-control  " name="Birth_City" id="Birth_City" style="color:  black;" required>
      <option value="">Please Select Birth City</option>
      <?php
      $sel_cus = "select city_name from personal_city_name order By city_name";
      $res_cus = mysqli_query($connection, $sel_cus);
      while ($row = mysqli_fetch_array($res_cus)) {?>
      <option value="<?php echo $row['city_name'];?>"><?php echo strtoupper($row['city_name']);?></option>
      <?php
      }
      ?>
    </select>
    <input type="text" autocomplete="off" onkeyup="this.value = this.value.toUpperCase();" class="form-control   "
           name="Birth_City" id="other" style="color:  black;" value="<?php echo $data['Birth_City']?>" required
           data-toggle="tooltip" title="Birth City" placeholder="Birth City"/>
  </div>
  <button type="submit" class="btn btn-primary pull-right"
          style=" margin-right: 430px; width: 105px; height: 42px; margin-top: 22px; " value="Save" name="Save"
          id="Save">Save
  </button>
</form>
 
     
     
    