How to create a webpage with some simple scripting criteria?
June 20, 2019 8:16 AM   Subscribe

I'd like to create a relatively simple web page that will be used to select choices from dropdown menus. Each dropdown menu will offer a specific set of choices based on what was selected in the dropdown menu above it. The final dropdown will contain items that the user can pick and the chosen items will be emailed to someone.

For example:

The page first shows one dropdown menu with the following items:
Shirts
Pants
Accessories

If "Shirts" is selected, a second dropdown menu appears and shows:
T-shirt
Button-down shirt
Sweater

If "Pants" is selected, the second dropdown menu appears and shows:
Jeans
Chinos
Dress pants

etc.


Then when the desired item is selected (let's say it was "T-shirt"), and the user clicks a "submit" button, "T-shirt" will be added to an email that will be sent to a specific address. But I'd also like the ability to add more than one thing, so for example, the final email should be able to contain multiple items from multiple categories, e.g. "T-shirt, Jeans" in the body of the email.

This sounds a bit like a shopping cart, but I really don't need that kind of robust functionality. I'm just trying to let the user pick specific items that will end up being sent in an email.

Also, this would obviously be open to abuse if it was on a public facing page (unless I implement some kind of login system which sounds way over my skill level), so would it be possible to have this page be stored locally on someone's computer or phone and still function like I need it to?

I used to dabble in HMTL and CSS for fun, but that was about 15 years ago, so my knowledge of web pages is stuck in the static page era. It sounds like I need to write a client-side script, and this project doesn't seem like it should be very hard, I just don't know where to begin.

Thanks!
posted by Quiscale to Computers & Internet (4 answers total)
 
Best answer: "Conditional Logic" is what you want for this form. Survey Monkey will do this for you, and I think Google Forms might also?
posted by DarlingBri at 8:23 AM on June 20, 2019


Best answer: Google Forms or Google App Maker might do the trick
posted by dawkins_7 at 9:21 AM on June 20, 2019


I believe that JotForm will do all this (caveat: I've never actually used it myself).
posted by alex1965 at 9:36 AM on June 20, 2019


You might check into interactive fiction software, such as Twine, and just adjust the styling to fit your needs. Interactive fiction usually presents a "Choose your own adventure" type story that changes based on choices the reader makes but the interface can be quite similar to what you describe and the software often produces a single self-contained web page like you're asking for.

Sending the email at the end might be a bit of a complication for a locally-stored web page, though. You could use a mailto: hyperlink but that depends upon the user's computer or phone being properly configured to pass the hyperlink to a working email client. If you want just anyone to be able to use it, rather than a small group of people who you can help if they have a problem, you might want to go with one of these solutions other commenters are mentioning, with server-side components involved that can handle sending the email consistently and successfully.
posted by XMLicious at 1:57 AM on June 21, 2019


« Older Cleaning Bathroom, No real ventilation   |   Snap to, Firefox, snap to! Newer »
This thread is closed to new comments.