Lead Capture Tools

gerardroman
Participant

Custom select on dropdown embed and prefix mobile country detection

SOLVE

Hello Everyone!

 

I have two questions, first i am wondering how i can change the value of a dropdown using embed forms using jQuery. On the other hand, does hubspot autoselect mobile prefix depending on the user's country connection?

 

Thanks!

 

0 Upvotes
1 Accepted solution
gerardroman
Solution
Participant

Custom select on dropdown embed and prefix mobile country detection

SOLVE

Hello again,

 

Finally I resolve the dropdown selection problem. The code I've used is:

 

$("#mobilephone_ext-56930237-1110-47c6-89d9-690aec7dcc4b").val(
$("#mobilephone_ext-56930237-1110-47c6-89d9-690aec7dcc4b option").filter(function() {
return $(this).text() === ipLookUp();
}).val()
).change();

 

Every time the user connect I detect from which city is and I auto select the mobile prefix and select the country flag too.

 

FYI, ipLookUp(); returns the user's country using the api http://ip-api.com/json

 

See you!

 

Bye

View solution in original post

1 Reply 1
gerardroman
Solution
Participant

Custom select on dropdown embed and prefix mobile country detection

SOLVE

Hello again,

 

Finally I resolve the dropdown selection problem. The code I've used is:

 

$("#mobilephone_ext-56930237-1110-47c6-89d9-690aec7dcc4b").val(
$("#mobilephone_ext-56930237-1110-47c6-89d9-690aec7dcc4b option").filter(function() {
return $(this).text() === ipLookUp();
}).val()
).change();

 

Every time the user connect I detect from which city is and I auto select the mobile prefix and select the country flag too.

 

FYI, ipLookUp(); returns the user's country using the api http://ip-api.com/json

 

See you!

 

Bye