Dynamic web forms

I am developing a web application that allows you to record and view reports on the Internet. These reports will have the structure of a typical school report or annual employee assessment report. I would like the user to be able to customize the structure of his report. For example, one school may need a report in the format

Subject Comment Score ----------------------------- English He sucks 20% Maths He rocks 88% Science About average 70% 

while another may wish

 Subject Grade --------------- English A Maths B Science C 

What I'm looking for is a way for each school to specify the format of its reports - perhaps some kind of JavaScript form library. Such a library can be used on a page that allows you to use to create a form that will be used as a template for their reports.

Since I need to process every report presented on the server side, I will need to capture some semantics about each field. For example, it would be great if the user could indicate whether the answer to each question in the report should be plain text, a numerical score, a flag, radio buttons, etc.

Any suggestions on useful technologies for handling such "dynamic" forms would really be appreciated. XForms seems like this might be relevant, but I haven't dug too deep into it yet.

Cheers, Don

+6
javascript forms xforms
source share
7 answers

A very good XForms-based form builder, (LGPL) http://www.orbeon.com/

Here you can see a demo of your form: http://www.orbeon.com/ops/fr/orbeon/builder/summary/

+2
source share

A pragmatic approach would be to use a google spreadsheet function called forms , (paid) services from wufoo or JotForm .

+1
source share

I agree with Jeff Beck's comments and also noted the following.

You said that your target audience is not technical, and all of the above solutions will be related to learning HTML and a complex template language, which may not be the starting one for your audience.

The above solutions also need more complexity than your problem requires. MooTools, Dojo, etc. Seem redundant. XForms and XSLT even more so. Yes, they will work and give you additional functionality, but do you need the level of complexity and debugging / support / training problems that come with these additional functions?

Your regular teacher or business user may have a general idea of ​​how to enter and save files in Excel. If you can teach them to save in CSV format and upload a form, or even better, install a macro that will be saved in CSV and publish it on your website, then this is probably the only training they need. To get the semantics, you can add a little more training and have the first row of the report — column names, and the second row — column type. It's not elegant, but easy, perhaps for those programmed with technology, to accept, as Jeff points out.

On the server side, I recommend the following stack:

Web server => node.js (possibly using Chain - github.com/hassox/chain)

Data Warehouse => Redis (and node -redis)

Templating => Haml-js (github.com/creationix/haml-js)

CSV parsing => See http://purbayubudi.wordpress.com/2008/11/09/csv-parser-using-javascript/ and be sure to use the fixed version, which is in the comments (for quoted commas).

Your more experienced users can configure HAML without compromising security, and HAML is pretty simple with a little training: this HAML ...

  %body .profile .left.column #date= print_date() #address= current_user.address .right.column #email= current_user.email #bio= current_user.bio 

produces ...

 <div class="profile"> <div class="left column"> <div id="date">Thursday, October 8, 2009</div> <div id="address">Richardson, TX</div> </div> <div class="right column"> <div id="email"> tim@creationix.com </div> <div id="bio">Experienced software professional...</div> </div> </div> 
+1
source share

I am in charge of XSLTForms and it seems like a good candidate for what you want to do.

XSLTForms features outperform the XForms 1.1 specification: client-side XSLT, SVG, and more.

Dynamic forms can be developed using XForms, and if this is not enough for your application, XSLTForms can combine the necessary extensions.

0
source share

I would suggest using:

  • a wiki engine or plain text to HTML converter such as Markdown to allow your users to customize the templates you provide.
  • HTML template library for inserting data using a specific template

For an HTML converter, you can use John Gruber MarkDown (in perl) on the server side or Javascript Port from John Fraser, Showdown .

There are many Javascript libraries available for HTML templates, depending on your selection:

0
source share

It should be easy to build in Smalltalk with Seaside . You have a WATableReport with WATableColumns. Just create a simple editor where each school can define these columns. I'm not sure if javascript or XForms are associated with it. As far as I know, XForms is currently dead if you cannot register a browser.

0
source share

I think that if the forms do not change too often, you should not give the system for non-technical users a mess with reports

rather make ur system easy for YOU to add new reports, in this case the client will send you a pdf / excel showing the desired format, and you can quickly come up with a new report

what I did for our accounting system, which is used for several clinics, we also charge a nominal fee for each report that changes (to prevent the user from changing the system thoughtlessly)

0
source share

All Articles