Formdown: rapid HTML form development

I'm working on a prototype for a web based application. For this prototype I need to create a lot of screens including forms. This is time consuming and not much fun if you need to change them every now and then. I would like to have something to:

  • Create forms quickly and easily
  • Modify forms quickly and easily
  • Generate the forms as (semantic) HTML so I can create a click through prototype

basically I would like to have something like Markdown to generate forms. I really like the fact that the syntax is simple and readable. So I came up with Formdown. I implemented a javascript version of Formdown. This still needs some work. I needed it quickly so the code might need some optimization. Please contact me if you would like to port this to other languages or if you have ideas to improve this version.

Update 2006-04-06: This version has bugs (fieldset don't work under IE, definition data isn't closed etc.)! I will fix them, but I'm not sure when.


Start a form:

%get|post action id

Start a fieldset (legend is optional):

+ Legend ---------------

Close a fieldset (dashes are optional):


Field label (exclamation mark indicates required field):

Field label !:


{{Submit button}} {Other button}

Input fields must be preceded by a label

Text input:





> Option
>* Selected option


[ ] Unchecked
[*] Checked

Radio button:

( ) Unchecked
(*) Checked

Formdown example


%get action.do myform

+ Personal data -----------------

Name            !: [_Jasper de Vries_]
Nickname         : [________]
Gender           : (*) male
                   ( ) female
Interests        : [*] Blogger
                   [*] speed skating
                   [ ] rain
Select something : > First option
                   >* Second option is selected
                   > Third option is no option
Remarks          : [[__________]]


{{Submit}} {Cancel}


<form method="get" action="action.do" id="myform">
<legend>Personal data</legend>
<input type="text" value="Jasper de Vries" />
<input type="text" value="" />
<label><input type="radio" checked="checked"/> male</label><br />
<label><input type="radio" /> female</label><br />
<label><input type="checkbox" checked="checked"/> Blogger</label><br />
<label><input type="checkbox" checked="checked"/> speed skating</label><br />
<label><input type="checkbox" /> rain</label><br />
<dt>Select something</dt>
<option>First option</option>
<option selected="selected">Second option is selected</option>
<option>Third option is no option</option>
<textarea cols="60" rows="6"></textarea>
<p class="buttons">
<button type="submit" class="Submit">Submit</button>
<button type="button" class="Cancel">Cancel</button>


Johan Sundström said...

Excellent idea!

Daphne said...

Seems detailed enough to follow. We need to simplify.

Andy Waite said...

Nice work. I've written about a similar implementation for Rails at http://www.andywaite.com/2007/8/5/markdown-for-forms