How to Prepopulate Phone Picker Widget with URL parameters?

  • partners653
    Asked on April 18, 2024 at 3:56 AM

    Hey!


    How can I add a phone number (+971541234567) to url parameter such that it get populated in the international phone picker widget?


    this is the current slug - /?cxphoneno=%2B971541234567&whatsappNumber=%2B971541234567

    How do I also do the same with drop downs? I have Gender field with two options - Male/Female. But the field is not being populated when I add it to the url Parameter

  • Israel JotForm Support
    Replied on April 18, 2024 at 6:23 AM

    Hi partners653,

    Thanks for reaching out to Jotform Support To include the following things in the parameter value, we want to pass the country name, so for example "United States", immediately after we want to pass the URL encoding character for a line break %0A, finally we want to add the country code "+1", a space, and the phone number "1234567899", so, for example:

    t_phoneNumber=Mexico%0A+52%201234567899
    t_phoneNumber=United%20States%0A+1%201234567899

    (Note that %20 is the URL encoding for a blank space, and, of course, %0A for the line break)

    That way, the input is going to be prefilled correctly:

    Solution: Prepopulate Phone Picker Widget with URL parameters Image 2 Screenshot 51 Screenshot 10

    Solution: Prepopulate Phone Picker Widget with URL parameters Image 3 Screenshot 62 Screenshot 21


    Give it a try and let us know how it goes.


  • partners653
    Replied on April 18, 2024 at 5:13 PM

    Sure, I'll check it out thanks! Also, what about the gender field?


  • partners653
    Replied on April 18, 2024 at 5:18 PM

    How to Prepopulate Phone Picker Widget with URL parameters? Image 1 Screenshot 30How to Prepopulate Phone Picker Widget with URL parameters? Image 2 Screenshot 41


    Hey, as suggested, I tried to use the sample you shared but it is still not being populated. Could you help me with this along with the Gender field I ask earlier? Thanks

  • Neal JotForm Support
    Replied on April 18, 2024 at 6:39 PM

    Hi partners653,

    Thanks for getting back to us. I’ll need a bit of time to look into this. I’ll get back to you as soon as I can.

    We really appreciate your patience and understanding while we’re looking into this.

  • Neal JotForm Support
    Replied on April 18, 2024 at 8:07 PM

    Hi partners653,

    Thanks for your patience, we appreciate it. For the flag using the International Telephone Picker widget, unfortunately, it can't be changed since you need to interact with it to be changed. For the number on the other hand as well as the gender, you can use the extension below beside your form's URL to display the prepopulated number and gender.

    ?cxphoneno=%2B971%2054%20123%204567&whatsappNumber=%2B971%2054%20456%20789&gender=Male

    Here are the codes added before the numbers:

    %2B = plus (+) sign

    %20 = white space

    Give it a try and let us know if you have any other questions.

  • partners653
    Replied on April 19, 2024 at 9:28 AM

    Hey! Thanks Neal, works great!

 
Your Answer