OK, here's what I grabbed just now.  Quick and dirty.  

I tried some of the translators online and they messed up coming back into 
HTML.  The suggested translator nested everything, so that was fun.  Then, 
the pulldowns needed nesting as well, to keep the selections all together 
in the <select></select> tags.  

Anyway, here's a quick reference in case anybody wants to post it online 
and keep it valuable.  Or add to it, etc.  

%form#form1{:name => "form1", :id => "form1", :action => "response.rb", 
:method => "post"}
%fieldset
%label{:for => "name"} Name
%input{:name => "name", :size => "10", :type => "text", :value => 
"Fred"}%br/
%label{:for => "myRadios"} My Radios
%input{:checked => "", :name => "myRadios", :type => "radio", :value => 
"red"}Red
%input{:name => "myRadios", :type => "radio", :value => "green"}Green
%input{:name => "myRadios", :type => "radio", :value => "blue"}Blue
%input{:name => "myRadios", :type => "radio", :value => "yellow"}Yellow
%br/
%label{:for => "myBoxes"} My Boxes
%input{:checked => "", :name => "myBoxes", :type => "checkbox", :value => 
"Canada"}Canada
%input{:name => "myBoxes", :type => "checkbox", :value => "US"}US
%input{:checked => "", :name => "myBoxes", :type => "checkbox", :value => 
"UK"}UK
%input{:name => "myBoxes", :type => "checkbox", :value => "France"}France
%br/
%label{:for => "myCars"} My Cars
%select{:name => "myCars"}
%option{:value => "volvo"} Volvo
%option{:value => "saab"} Saab
%option{:value => "fiat"} Fiat
%option{:value => "audi"} Audi
%br/
%label{:for => "myTextarea"} My Textarea
%br/
%textarea{:cols => "60", :name => "myTextarea", :rows => "10"}Smart people 
drink real beer
%br/
%input#form1Submit{:name => "form1Submit", :id => "form1Submit", :type => 
"submit", :value => "GO"}

Renders:
<form action='response.rb' id='form1_form1' method='post' name='form1'>
  <fieldset>
    <label for='name'>Name</label>
    <input name='name' size='10' type='text' value='Fred'>%br/</input>
    <label for='myRadios'>My Radios</label>
    <input checked='' name='myRadios' type='radio' value='red'>Red</input>
    <input name='myRadios' type='radio' value='green'>Green</input>
    <input name='myRadios' type='radio' value='blue'>Blue</input>
    <input name='myRadios' type='radio' value='yellow'>Yellow</input>
    <br>
    <label for='myBoxes'>My Boxes</label>
    <input checked='' name='myBoxes' type='checkbox' 
value='Canada'>Canada</input>
    <input name='myBoxes' type='checkbox' value='US'>US</input>
    <input checked='' name='myBoxes' type='checkbox' value='UK'>UK</input>
    <input name='myBoxes' type='checkbox' value='France'>France</input>
    <br>
    <label for='myCars'>My Cars</label>
    <select name='myCars'>
      <option value='volvo'>Volvo</option>
      <option value='saab'>Saab</option>
      <option value='fiat'>Fiat</option>
      <option value='audi'>Audi</option>
    </select>
    <br>
    <label for='myTextarea'>My Textarea</label>
    <br>
    <textarea cols='60' name='myTextarea' rows='10'>Smart people drink real 
beer</textarea>
    <br>
    <input id='form1Submit_form1Submit' name='form1Submit' type='submit' 
value='GO'>
  </fieldset>
</form>



On Monday, December 8, 2014 4:27:25 PM UTC-5, Duncan Beevers wrote:
>
> It's just like html.
>
> In html you'd write
>
> <form>
>   <label>Username</label>
>   <input name=“username” type=“text" />
>   <label>Password</label>
>   <input name=“password” type=“password />
> </form>
>
> In haml you'd write
>
> %form
>   %label Username
>   %input(name: "username", type: "text")
>   %label Password
>   %input(name: "password", type: "password")
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/haml.
For more options, visit https://groups.google.com/d/optout.

Reply via email to