I have created a sign up page with a country select field using the following liquid tag... {% collection_select "country_code", page.signup.countries, "code", "name", class:"select" %} ...The field displays fine on the front but the input to the field doesn't seem to get recorded in the sign up's location info. Am I doing something wrong? Any help would be greatly appreciated!
Official response from Taylor Pineiro
Please see below.
Share this post
Showing 8 reactions
Sign in with
Apologies for the slow response.
Thank you so much for this, it was really helpful and exactly what I needed.
Thanks Yaseer as well, with both of your help I finally got there! Really appreciate it.
All the best.
http://jsfiddle.net/f23uP/200/
You can copy the HTML code directly into your signup page and it will work accordingly. Keep in mind that you would still need to hide the input field for your users.
Make sure to put the script at the bottom of the page level template in your signup page.
I just found out a simpler way to do this as well without any of the mess of JavaScript —
This idea would be to just use this code in your signup page here:
https://gist.github.com/asimoesmcartor/e0ca502e1a5e43d1019e2dec640ac0b9
You would just need to copy all the code out of the gist and paste it into your signup page.
Thanks again.
We did send out an email response last week to the email address behind this account. Happy to include the contents of that email here as well.
In this case, you are trying to use the user submitted country field without submitting a user submitted address. If the user was to fill out a normal user submitted address, the country would submit with that address.
As an alternative, we would recommend using the home address country code field here:
{% text_field “home_address.country_code”, class:“text”, placeholder:“Country Code” %}
This field is a text field, but you can create your own select dropdown menu if you would like. From there, you can parse the data from the dropdown into the text field. This will allow the user to still use a dropdown menu, but the data is actually submitted through a text field.
Let us know if you have any trouble with this!
You can see the staging version here…
http://alde-danielpomlett.nationbuilder.com/subscribe
Would you be able to provide a link to the signup page in question to [email protected]? We’d be happy to dig into what might be happening here and propose an adequate resolution!