Viewing 1 replies (of 1 total)
  • Plugin Author Kreg Wallace

    (@kreg)

    To use a dropdown for countries on the shortcode form, edit includes/emailpetition.php, changing lines 107-108 which look like this:

    <label for="dk-speakup-country-' . $petition->id . '">' . __( 'Country', 'dk_speakup' ) . '</label>
    <input name="dk-speakup-country" id="dk-speakup-country-' . $petition->id . '" maxlength="200" type="text" />

    to something like this:

    <select id="dk-speakup-country-' . $petition->id . '">
    	<option value="Australia">Australia</option>
    	<option value="New Zealand">New Zealand</option>
    </select>

    Just keep adding more option tags to the list for each country you want to include.

    For the cities, you probably don’t really want to do this because there are an awful lot of cities in each country and providing options for each one would take forever. But if you wanted to try, I’d suggest searching Google for something like ‘javascript poppulate select box’. You’ll find lots of tutorials on how to do this.

Viewing 1 replies (of 1 total)
  • The topic ‘how to add drop down values for city and country fields’ is closed to new replies.