views:

43

answers:

1

I am creating a front-end for a data collection web application. Operators using the data collection application will log data for a dozen different projects, with each project requiring different fields. There are some common fields (like name, address... etc) but then each project also has custom fields for extra data that needs to be collected. Some projects require dozens of extra fields, while some projects require only 1 or 2 fields. Can anyone think of a "clean" way to handle this situation? I don't want to create an input page for each project, and some people are tossing around the idea of doing UI templates in XML. Any guidance would be much appreciated.

+1  A: 

XML would provide a neat solution to your problem. Depending on the user choice, ask the user to fill more fields. From your problem statement its looking that you know how many projects need extra fields and which do not. If you know this data then feed this data into a database and then accordingly generate your form page. However even if the data is available dynamically with the use of an interactive javascript and ajax you can easily achieve a neat solution.

stack programmer
Some of the form fields control other form fields (like picking certain items in a dropdown might hide/show some textboxes). It's things like this that make me hesitant to use XML as the solution. I could javascript in the XML doc to control this client side, but what about server side validation?
Jon Tackabury
There are server side php validation scripts available on internet which you could easily use for your purpose
stack programmer