Support » Plugin: Contact Form 7 » Make an HTML select field required in CF7

  • Hi there,

    I have a working form with a country and city drop down menus using onChange event, my problem is I can’t get these drop down menus to be required as the rest of the fields. I can only make a field with square brackets [] required by placing the “*” but a normal brackets field <> doesn’t approve the “*” thing.

    Here is my CF7 form code:

    <h4>Name</h4><br />
        [text* your-name]
    <h4>Birth date</h4><br />
        [date* Date date-format:dd/mm/yy]
    <h4>Country</h4><br />
    <select name="country" id="country" onchange="cityChange(this);">
        <option value="empty">Select a country</option>
        <option value="EG">Egypt</option>
        <option value="JR">Jordan</option>
    <h4>City</h4><br />
    <select name="city" id="city">
        <option value="0">Select a city</option>
    <h4>Email</h4><br />
        [email* your-email]
    <h4>Mobile Number</h4><br />
        [tel* Mobile]
    <h4>Optional Notes</h4><br />
        [textarea Notes 60x3/1000 placeholder "Need to tell us anything else?"]
    <br />
    <p>[submit "Register ยป"]</p><br />

    Thanks a lot in advance.

  • The topic ‘Make an HTML select field required in CF7’ is closed to new replies.