Create City/State/Country Dynamic Drop-Down List

This topic contains 13 reply and 3 voices, and was last updated by Mahi 9 years, 8 months ago
Viewing 13 Posts - 1 through 13 (of 13 total)
Author Posts
May 28, 2014 at 9:21 pm 21132
Mahi Hello, How I can create a City/State/Country dynamic dropdown list in my "WP User Frontend Pro" form? Thanks, Alexander
May 29, 2014 at 2:48 pm 21160
Oritro Ahmed Oritro Ahmed

Hello Alexander,

What you are asking, is kind of Complex right now. WPUF don’t provide base functionality for Conditional Logic, Which is coming from our next update landing next month. Till then, Either you have to write the whole thing based on jQuery or Using WPUF action hook.

May 29, 2014 at 9:34 pm 21191
Alexander Alexander

Hello Ahmed,

I have a list of countries, states and cities.
What WPUF action hooks I need to use in order to create City/State/Country dynamic dropdown?

Thanks,
Alexander

May 29, 2014 at 10:25 pm 21195
Oritro Ahmed Oritro Ahmed

Hi there,

We have a Full Featured Documentation Section about the Action Hook. Please check here: http://docs.wedevs.com/using-action-hook-field/

May 31, 2014 at 1:00 am 21257
Alexander Alexander

Hello Ahmed,

In this documentation I find that WP User Frontend gives two actions: 1) when a post is submitted: wpuf_add_post_after_insert or 2) when a post is updated wpuf_edit_post_after_update.

However, I need some action when user edit post and before submitting/updating. For example, when user is change country dropdown selection, than the states dropdown list is changes also.

What WPUF action I can to use in this case?
Is this conditional logic coming in you next version? If yes, I can wait next month.

Thanks,
Alexander

May 31, 2014 at 3:01 am 21263
Oritro Ahmed Oritro Ahmed

Hello Alexander,

Yes, Conditional Logic is coming next month. Probably the 2nd Week.

July 26, 2014 at 3:25 am 24130
Alexander Alexander

Hello,

I install new version of WP User Frontend Pro 2.2.3.

I try to implement the simple example with two dropdown fields country and city. Country dropdown field contain two items:USA,Canada and city dropdown field contain four items: New York,Las Vegas, Toronto, Ottawa.
I would like to show cities of selected country, but without result.

Is’t possible to use conditional logic to implement this example?

Thanks,
Alexander

July 27, 2014 at 8:56 am 24158
Mahi Mahi

Very much possible Alexander.

Step 1: Create a drop down field with country list

Step 2: Create another drop-down City list (USA Field) with meta name city_usa and put your 2 city names.
Then, mark conditional logic = yes.
now, select Country field and “is equal to” USA

Step 3: Create another drop-down field for Canada with meta name City_canada and put your city names
then same as Step 2 mark Conditional logic = yes
and, Select Country field “is equal to” Canada

Thats it.

July 27, 2014 at 1:49 pm 24178
Alexander Alexander

Hi Mahi,

I’ve been all the steps, but this not working. If I select USA/Canada then no reaction on “conditional logic” flag. The wpuf form displays three drop-down fields : country_field, city_usa and city_canada.

Is need any additional step for “conditional logic” ? Have you example and documentation about “conditional logic”?

July 27, 2014 at 2:10 pm 24179
Mahi Mahi

i am not sure how easily i can explain!

you have to select Conditional logic on two city fields only not country field.

July 27, 2014 at 4:56 pm 24188
Alexander Alexander

I understand you.

I create three “Dropdown Custom Fields” and select on two city fields only :
“conditional logic=yes”
“Country is equal to USA/Canada” and
“Show this field when “any” these rules are met”.

But “conditional logic” has no effect.

Can you test your example or may be I need additional setting?

July 27, 2014 at 5:13 pm 24189
Mahi Mahi

i tested my self. It is working fine. Would you mind to share your site login details then to check? please reply as private.

July 31, 2014 at 6:51 pm 24350
Alexander Alexander

Hi,

I test this example and understand that solution with three drop-down lists is not suite for me.

Therefore, I would like to extend my existed ‘wpuf’ form (contain user data like name,birthday,etc.) and create by program code two drop-down fields( ‘country’,’region’).

How and where I can create a drop-down input field by program code to existed ‘wpuf’ form?
How I can add values to drop-down field from mySql table?

August 1, 2014 at 5:34 am 24360
Mahi Mahi

Not sure what do you mean by two/three drop-down field. People will see only two Drop-down fields if you apply conditional logic and you can easily manage data by using two different meta_key.

WPUF uses default WordPress data table. _postmeta > meta_key

But, It is not recommend to edit SQL file directly.

Viewing 13 Posts - 1 through 13 (of 13 total)