Repetition Model for HTML DOM
Features
This Javascript library implements the Repetition Model originally planned for inclusion in the official Web Forms 2.0 specification.
History
The Repetition Model was abandoned as an official standard for declarative HTML, however, you can implement or emulate this standard using this Javascript library, as anticipated by WhatWG/ W3C.
Javascript source code
Please view the source code here.
Licence—freeware (GPL2)
See the licence declaration at the head of the source code for more details. Since the original version was GPL2-licensed, all subsequent versions (including our updated versions of this code) must be distributed under a similar GPL2 licence: we are fulfilling our legal & moral obligations to the original developer and the broader software community, by supplying this software freely to you under these terms. We have chosen not to charge a redistribution fee for this product at this time.
Instructive examples
When first working with the Repetition Model from the Web Forms 2.0 prototype specification, I found these examples & tests most instructive. The partial adoption of the original Web Forms 2.0 specification into HTML5 broke the original Javascript implementation, which interpreted indications of Web Forms 2.0 support to imply implementation of the abandoned Repetition Model. To make these examples work, I have transferred them to this site by kind permission of the author (Mr. Weston Ruter), to demonstrate them working with my updated Javascript code.
- Specification: Sample Order Form
- Specification: Repeated rows
- Specification: Nested repetition (Solar system)
- Movement Buttons and Cancelling Default Action
- Repetition Index in Attributes
- Repetition Events
- Repetition Event Handler Attributes
- Initialization Time
- Repetition Buttons
- Orphan Repetition Blocks
- Disabled Form Fields in Template
- repeat-min, repeat-max, & repeat-start attributes
- Repeated Photo Albums
- Exceptions in Repetition Events
- Required Elements in Repeated Blocks
- Autofocus on unfocusable form control
- Form validation
- Input Controls in Nested Repetition Blocks
- Prefilling form data
- Creating Repetition Templates Dynamically
- "required" attribute on checkboxes & radio buttons
How we are using the Repetition Model:
- Bin-packing algorithm: problem specification user-interface
- Professional mentor search-engine: category & location filters
Authors and contributors
- Original specification proposal written by Ian Hickson (around 2005–2006)
- Developed by the WhatWG (2006–2008) as part of the original Web Forms 2.0 specification
- Javascript implementation written by Weston Ruter (2007)
- Refactored, debugged, updated and improved by Zoltan Hawryluk (2010)
- Debugged by Hallvord R.M. Steen at Opera Development (about 2011–2012)
- Updated (during 2011‒2015) by Matthew Slyman for compatibility with the final Web Forms 2.0 specification. Also removed vestigial implementations in Javascript of parts of Web Forms 2.0 which have since been incorporated into the final official HTML5 specification.