[whatwg] WF2 Repitition Model
Matthew Raymond
mattraymond at earthlink.net
Sun Jun 27 09:25:27 PDT 2004
I was thinking something like that too, but I made a different system...
---------------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<!-- File: solar_templates.html -->
<html>
<body>
<template type="define" name="planets" id="planet[planets]">
<li>
<label>Name:
<input name="[_self_id].name" required="required"/>
</label>
<h3>Moons</h3>
<ul>
<repeat template="_child_0" start="0" />
</ul>
<p><button type="add" template="_child_0">Add Moon</button></p>
<p><button type="remove">Delete Planet</button></p>
</li>
</template>
<template type="define" name="moons" id="[_parent_id].moons">
<li>
<input name="[_parent_id].moon[moons]"/>
<h4>Moonlets</h4>
<ul>
<repeat template="_child_0" start="0" />
</ul>
<p><button type="add" template="_child_0">
Add Moonlet
</button></p>
<p><button type="remove">Delete Moon</button/></p>
</li>
</template>
<template type="define" name="moonlets" id="[_parent_id].moonlets">
<li>
<input name="[_parent_id].moonlet[moonlets]"/>
<button type="remove">Delete Moonlet</button/>
</li>
</template>
</body>
</html>
---------------------------------------------------------------------------
---------------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<!-- File: solar.html -->
<html>
<head>
<title>Solar System</title>
</head>
<body>
<template type="load" name="planets" href="solar_templates.html">
<template type="load" name="moons">
<template type="load" name="moonslets" />
</template>
</template>
<form>
<h1>Solar system</h1>
<p><label> System Name: <input name="name"/></label></p>
<h2>Planets</h2>
<ol>
<repeat template="planets" start="0" />
</ol>
<p><button type="add" template="planets">Add Planet</button></p>
<p><button type="submit">Submit</button></p>
</form>
</body>
</html>
---------------------------------------------------------------------------
We're going to make poor Hixie have a nervous breakdown... ;)
More information about the whatwg
mailing list