This is an open question. I am trying to write HTML pages for defining / editing questions (database objects). A question is composed of a small text and a type: the type indicates its declination. The question declinations are, for example, slider, yes-no, free-text or multiple choice. For the free-text and yes-no declinations, no further information is needed. But for the slider and multiple choice ones, additionnal information have to be entered.
Now what I done / tried is create form, view and template to define a generic question, and create sub forms, views and templates for each question declination that needs additionnal fields.
The problem is that I encounter difficulties to keep the generic question id in the sub forms to attach the additionnal fields to the question. I tried to pass it to the sub view, but I must have access to it in the form too to save the database object with the question reference, so it means adding a hidden input field in the form, which leads to other issues, etc etc...
What I lack is web-development experience... The better thing I could get is dynamic drop-down menus adapting to the selected question type, but I do not know javascript or ajax language for now, so a few different views/templates would be enough.
What would be the easiest / best way to achieve this ? I am not asking for code but rather something like a methodology.
Please let me know if I missed something that makes the question incomprehensible.