Forums

Pass Arguments in URL to a Chronoforms 6 Form, but protext them before being changed. | Transmitt Price value in URL or so and make it unchangeable

JaHollYT 27 Oct, 2019
Hey there, i am working on an art Website where people can browse around and if they like an artwork klick on an button.
Then an Intresst Chronoform is open where the Person have to give some informations like an mail adress and then when the form is submitted i receive an mail.
In the Form and the Mail i also want to pass information about the artwork the Person is interested in. Like name, artist, price. I did this using the &parameter=something
in my url. The Point is i dont want people to change the Name or the Price.

My Question is, how can i transmit something like a price to a form, but protect it from being changed. Or can i do something else to reach my goal?



Greetings,
Jakob
GreyHead 28 Oct, 2019
Hi Jakob,

Save the URL data to the User Session in the form On Load event, then read it back in the On Submit event.

Bob
JaHollYT 28 Oct, 2019
But when someone then changes the price value for example from &price=100 to &price=10 in the URL and reload the Page, the Problem is still there - then the wrong price is saved for the session, right?

Actually i cant find a "Save to session" module or something to do...


Another idea is to just transmit the name of the artwork in the URL and load the other information from the database, but i think its very difficult too.
JaHollYT 28 Oct, 2019
Edit: I decide to use a database-table where all information are stored and that every artwork get a number.

Problem now: I want to load data from the database, save them in vars to use them in the form.

This is how my read-Data Model is looking right now:



Is it correct to load every colum with Model.Nr and how can i transfer the information from the row(given by data:id, with the url) into the vars.
So for the Nr colum into a Nr var and from the Title Colum into the Title var and so on...

My Database-Table looks like this;
healyhatman 28 Oct, 2019
You don't need to put every column in Fields to retrieve - if it's empty it will just get them all.

There's a save to session under Services

When you say you want to "use them in the form", how exactly do you want to do that?
JaHollYT 28 Oct, 2019
Thanks for your help!
To use means i want to display them in the form and then on submit send them in a mail.



So for example someone likes the second artwork.
Then i want the id to be 2. The Price should be the price of row 2 of the table and so on.
And then i want to display all this information for the special artwork and send them in a mail on submit

So how do i use them: {model:id} ?
JaHollYT 29 Oct, 2019
I found a Solution - i used the "Data Builder 2" to make data out of the {var:read_data8.Model.NAME}.
Now i can use the data simply with {data:NAME}.

Thank you all for your help!

#Solved - #Closed - #Close
healyhatman 29 Oct, 2019
Answer
1 Likes
OR you can use simply {var:read_data8.Model.NAME}

Also you don't need to add everything to the form - you ONLY need to add the ID. Then use that on submit to read the database again, set to First Matching, to get all the data.

Because if I found out the website I was purcahsing things on had all their prices done through the front end, I would ABSOLUTELY set the prices of everything to 0.
JaHollYT 29 Oct, 2019
Thats true, thank you very much🙂!
This topic is locked and no more replies can be posted.