Forums

Simple Order Form

fiorrr 11 May, 2021
Hi! I'm totally lost with the new Chronoforms.
I want to create a simple order form, that allows the user to only order what is available. So I want one form where I can write to the database that I have 20 bottles of beer left.
And the other form should be the order form that allows a customer to order beer, only when it is available. So I need to read that value from the database. It doesn't need to update the database, I want this to be done manually.
How do I get this to work?
GreyHead 12 May, 2021
Hi fiorr,

The first form would need to read the current data from the table to get a list of products. A drop-down is the simplest way to do this if the list is not too long. Once you have selected a product you'll need an input field to enter the new quantity. Then on save you will write the new data back to the table.

The second form will be similar in the first part - reading the data to show products and quantities. I would then probably use Javascript to disable the input box or boxes where the quantity is zero. Or you could use a selector for the read statement to only get products where the current quantity os greater than zero.

Bob
fiorrr 12 May, 2021
Hi Bob,

what you're describing is pretty much what I'm trying to do, even a bit simpler than that. I can write something to the DB, but didn't figure out yet how to read that data from the DB and use it in the form.

I'm just trying to write a number of eggs to the database, that is working fine. Don't know it I did it right, and I hope uploading a screenshot works.🙂
You need to login to be able to post a reply.