Best way to develop a conditional form with fields that hide, show, clear and follow a series of steps?
I am creating a form that represents a lab procedure to follow step by step where each step is a field dropdown (Yes/ No) and may require data to be collected in a separate field. The steps are all conditional decisions and could lead a user down a different path each time. A user can also go back a step and choose a different value which then takes them down a different path.
How can I accomplish this and be able to maintain the flow/ path and make changes to it? I don't think hard coding the conditionals in the form is th eright way to do it. It is hard to maintain. This functionality is the key feature of this application.
Issues: I am testing an example with hide and show in my script which works, but is hard to maintain. An issue is that when you go back to say step 3 of 10, that not all the fields are then hidden and also contain bad data which needs to be cleared from fields so as not to be saved to the database on submit.
Example:
Step 1- Perform test1
What color is the test?
If test1 is BLUE, then go to Step 2, if test1 is RED, then go to Step 5
Step 2- Record Temperature
What is the temperature?
If temp1 is 100, then go to step 3, if temp1 is 200, then go to step 8
-
-
-
-
Step 5- Record Time
What time is it?
If time is 1 minute, then go to step 10, if time is 5 minutes, then go to step 9
Now if you want to go back to redo an answer, you could go down a totally different path and need to clear all your fields back up to that step.
Please let me know how this can be done.
Thanks.