Link to home
Start Free TrialLog in
Avatar of jaw0807
jaw0807Flag for United States of America

asked on

Multiple Questions for each dropdown listing

(I normally use classic asp for this) but would be willing to learn other options.  

I am creating a web form and want the following to occur:

Pick user name from dropdown (no problem, know how to do this)

Next dropdown is a list of holidays (ie Christmas, Thanksgiving etc)

I want the user to be able to pick a holiday, but not submit the form yet because I want them to answer questions for each holiday.

So if they pick the first holiday - ie Christmas - I then want a field or fields that show a calendar.  I want them to select the days they are closed for that holiday.  

Then another issue (question) would be if they are closed all day or partial day.  I really don't need the details of the partial day (ie 6 hours, closing 2 hours early etc) just that it's not all day.   At times they may select up to 4 days around Christmas that they are closed all day or partial days.

Then when they have finished Christmas I want them to move on to New Year's. Once finished then they click submit and submit the results to the database.  At this point how many columns would I set in the database - something like 6 columns to cover all scenerios?  Or if partial it goes into one column and if full day it goes into another column.  Not knowing what they will pick is an issue (for me).  I normally deal with standard answer type forms.

 They would only fill out this data once a year.  Normally I do a survey for each holiday but would really like to have this more automatic - plus display results back more automatically.
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

I would suggest paying a gig for this if you want someone to build out the full form. Otherwise, if you have specific questions, post those.
If the number of combinations are fixed and relatively small - make provision for them as fields in the database.

Otherwise create a related table that stores the parent id and the time / date options chosen.

The second option gives you the most flexibility with your data model but it is a bit more complicated to implement.

I would do it like this
Parent table:
(store details)

Child table:
ParentID: (store)
Holiday: (Christmas / New Years)
Date: (date for the closed / partially closed)
Type: Closed / Part day

You would then create a new record for each store / holiday / day closed | partially closed combination.

It does make for a slightly more complicated solution but it is the one that is guaranteed to cater to your situation.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.