W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2004

[whatwg] WF2 Repitition Model

From: Matthew Raymond <mattraymond@earthlink.net>
Date: Sun, 27 Jun 2004 12:25:27 -0400
Message-ID: <40DEF4F7.90008@earthlink.net>
    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... ;)
Received on Sunday, 27 June 2004 09:25:27 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:18 UTC