Skip Navigation

[Resolved] Using javascript/jquery to prepopulate an address field on a custom post form

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 1 reply, has 1 voice.

Last updated by nicholasE 1 year, 9 months ago.

Author
Posts
#2541241

Tell us what you are trying to do?
I have created a custom post type that uses a google address field. I have created a custom post form for this. I have embedded this post on its own page. This page/form will be called from different places within the website. I want to pre-populate some of the form fields using javascript/jQuery based on parameters passed in the Query String.

One of the fields is a Google address field. This website is UK based and I would like to pre-populate the Google Address field if a query string parameter called "postcode" has a value, e.g. NP33BHY.

I can of course read the query string and set the google address field input but this does not seem to be triggering the google lookup and does not set the address. I have tried to send an enter key trigger to the input but this is also not work.

Is there a way to trigger the google address field once I've set the input box value.

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?

#2541339

I completely missed that you can pull query string parameters directly into the custom form using set default parameter from url parameter in the form builder