Is it possible to use URL GET parameter to set default value in new detail view form?

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
ppfoong
Posts: 5
Joined: 2021-07-13 16:46

Is it possible to use URL GET parameter to set default value in new detail view form?

Post by ppfoong » 2021-10-29 03:02

I am trying to make an event sign-up form with AppGini to replace the use of Google Form for the same purpose.

I use the same form for different events, and there is a selection field for user to choose which event he/she is signing-up for. The form looks like this:
Snipaste_2021-10-29_11-00-29.png
Snipaste_2021-10-29_11-00-29.png (65.94 KiB) Viewed 1090 times
Is it possible to just provide the URL with the specific event, so the selection is already made when the user enters the sign-up form, such as this?

http://server.com/registration_view.php?eventid=1
http://server.com/registration_view.php?eventid=2
http://server.com/registration_view.php?eventid=3

Thank you.

ppfoong
Posts: 5
Joined: 2021-07-13 16:46

Re: Is it possible to use URL GET parameter to set default value in new detail view form?

Post by ppfoong » 2021-10-29 03:09

All the linked related information including description, presenter, language, date, time and venue should also automatically displayed accordingly, in the same way as if the user has selected the event name.

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Is it possible to use URL GET parameter to set default value in new detail view form?

Post by pbottcher » 2021-11-08 22:08

Hi,

just as a thought.
You could create the base records already upfront in your database. E.g. data for eventid=1, eventid=2....
Now you can present that link to the user (http://server.com/registration_view.php?eventid=1). Instead of the "Save New" button the user will get an "Save changes" button, but you could change that to your needs.
Once the user hits the "Save changes" button, you catch the data in the _before_update hook and create a new record with the entered data.
For the exisiting record you reset the data the your default data and store that.

Now the user has actually created a new record with the presets you have provided in the specific event link.

Hope I made that clear enough.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

Post Reply