Populating Form from URL Address

bobjones 22 Aug, 2013
Hello! Can you point me in the direction of a turorial/article of how I can populate a form from an URL address?

For example, I want specific users to update his/her data and have a number of data elements for that user that I already have to be pre-populated on the form for his review/edit.

Thanks!
bobjones 23 Aug, 2013
<bump>
Any direction? Thanks!
GreyHead 24 Aug, 2013
Hi bobjanes,

If they are logged in users you can use their User ID to retrieve data (there's a FAQ on getting the ID); if you have a value in the calling URL it will be automatically added to the $form->data array.

In either case you can use a DB Record Loader to retrieve data from a database table and, provided that the column names match the input names that will be republished in your form.

Bob
bobjones 26 Aug, 2013
Great, thank you. A couple of follow-up items.

Let's say that I want to pre-populate the form with the following data from the URL:
FirstName: John
LastName: Jones

I do not need this URL to pull any data from the DB. All I would like is for the URL to populate the form with these two fields so that the person can John Jones can then fill in the remaining information.

How would I need to structure the URL to do that? Do I need to modify anything else on the form side?

Thank you.
bobjones 27 Aug, 2013
Any feedback would be greatly appreciated. Thanks!
GreyHead 28 Aug, 2013
Hi BobJones,

Add &FirstName=John&LastName=Jones to the URL.

Bob
bobjones 28 Aug, 2013
GreyHead --

Exactly what I needed! Thank you!
This topic is locked and no more replies can be posted.