-6

I want to make it compulsory for user to select one of the option in city , if he will not select the drop down option , the form will not submitted. But it is not happening...following is the code... request you to please help... will be of great help.. thanks..

                           <label>Your City</label>

                            <select name="c_city"  class="form-control" required>

                          <option > Select City </option>
                          <option  value="Delhi/NCR" > Delhi/NCR </option>
                          <option  value="Chennai" > Chennai </option>
                          <option value="Mumbai" > Mumbai </option>
                          <option value="Bangalore" > Bangalore </option>
                          <option value="Hyderabad" > Hyderabad </option>

                      </select>
Sachin
  • 91
  • 3

1 Answers1

1

I believe the problem is that you need to change the Select City into a null value for the required to work:

<option value=""> Select City </option>
  • Thank you so much.. it is working fine now.. i am very greatful to you..... thanks once again. – Sachin Apr 26 '19 at 16:08