Support

Home Forums Event Espresso Premium Default country

Default country

Posted: December 26, 2017 at 7:44 pm

Viewing 5 reply threads


Avi

December 26, 2017 at 7:44 pm

Hi there,

Based on existing threads, I was hoping the following javascript would set the country for new registrants to Canada by default, but didn’t work. Can you assist?

jQuery(document).ready( function($) {
jQuery(“select[id$=state]”).val(60);
});

Thanks in advance!

Avi


Avi

December 26, 2017 at 7:45 pm

Hi there,

Based on existing threads, I was hoping the following javascript would set the country for new registrants to Canada by default, but didn’t work. Can you assist?

jQuery(document).ready( function($) {
jQuery(“select[id$=country]”).val(39);
});

Thanks in advance!

Avi


Avi

December 26, 2017 at 7:48 pm

Sorry, replaced by more recent post — please delete.


Josh

  • Support Staff

December 27, 2017 at 8:36 am

Hi Avi,

First did you verify that your custom JavaScript got loaded onto the page? Can you post a link to an event page so we can investigate?


Avi

December 27, 2017 at 3:51 pm

Hi Josh,

Yes, seems to be loading! If you take a peek at lisgar.net/register/175 and spot something obvious that I did wrong, great. But super low priority, really — if users need to pick the country themselves, that’s fine. Just thought this would be a nice easy thing to do (but maybe not). 🙂

Avi


Josh

  • Support Staff

December 27, 2017 at 6:41 pm

You can replace the middle line of JavaScript with:

jQuery('.ee-reg-qstn-country').val('CA');


Avi

December 27, 2017 at 6:43 pm

Thanks, Josh — you guys are great!

Avi

Viewing 5 reply threads

The support post ‘Default country’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso