• Resolved inula

    (@janetb)


    Hi,

    I’m using EM 5.6.1.
    I would like to change the region into a dropdown at the add-event-form.

    Made following changes in templates/forms/event/location.php and changed that field to a select with our specific regions.
    Adding a new location, everything works fine. I can see in admin-section, the region is added correctly in database.
    When retrieving existing location in front-end, added region does not show. What am I missing??

    <tr class=”em-location-data-region”>
    <th><?php _e ( ‘Region:’, ‘dbem’ )?> *</th>
    <td><select id=”location-region” name=”location_region”>
    <option value=”0″>Selecteer provincie</option>
    <option value=”Groningen”>Groningen</option>
    <option value=”Friesland”>Friesland</option>
    etc. etc. etc.
    </select>
    </td>
    </tr>

    https://www.ads-software.com/plugins/events-manager/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Which page are you using that code on?

    Thread Starter inula

    (@janetb)

    I’m using it at the add-event page.
    When you start typing locationname and then choose an existing location, all the fields are filled. But since I made the dropdown, region is not filled anymore.

    Thread Starter inula

    (@janetb)

    Found it:
    Of course I had to add “selected” in the drop-down list…
    file: events-manager/includes/js/events-manager.js

    //Finally, add autocomplete here
    //Autocomplete
    OLD: jQuery(‘input#location-region’).val(ui.item.region);
    NEW: jQuery(‘select#location-region option[value=”‘+ui.item.region+'”]’).attr(‘selected’,selected’);

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Region not showing with Drop-down.’ is closed to new replies.