WordPress.org

Ready to get started?Download WordPress

Forums

SpeakUp! Email Petitions
[resolved] how to add drop down values for city and country fields (2 posts)

  1. Gigih Wahyudi
    Member
    Posted 1 year ago #

    Hi, Kreg

    I have a question for you. How to add drop down values for city and country fields ?

    Thanks for your help

    http://wordpress.org/extend/plugins/speakup-email-petitions/

  2. Kreg Wallace
    Member
    Plugin Author

    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.