I know how to toggle (active/disabled or visible/hidden) html form input fields with JavaScript.
But if there are several input fields, I guess it is better to use a declarative solution. I mean a solution without coding methods which use long "if ... else ..." statements.
Simple example:
The customer can enter if he likes long distance running. If he enables this, an other input gets visible: "What is your preferred running distance?"
I can code (and have done many times) "if ... show ....", but I am not a JS expert.
How could this be done declarative in JS?
http://en.wikipedia.org/wiki/Declarative_programming:
In computer science, declarative programming is a programming paradigm, a style of building the structure and elements of computer programs, that expresses the logic of a computation without describing its control flow.