Source

django-formrenderingtools / django_formrenderingtools / templates / tests / formrenderingtools / form_output.html

<!-- The default layout with a valid form -->
<form>
  <div class="formItem required subject">
    <label for="id_subject" class=" required">Subject</label>
    <input id="id_subject" type="text" name="subject" maxlength="100" />
  </div>
  
  <div class="formItem required message">
    <label for="id_message" class=" required">Message</label>
    <input type="text" name="message" id="id_message" />
  </div>
  
  <div class="formItem required sender">
    <label for="id_sender" class=" required">Sender</label>
    <input type="text" name="sender" id="id_sender" />
  </div>
  
  <div class="formItem cc_myself">
    <label for="id_cc_myself" class="">Cc myself</label>
    <input type="checkbox" name="cc_myself" id="id_cc_myself" />
    <p class="help">Send a copy of the message to the sender.</p>
  </div>
  
  <input type="submit">
</form>

<!-- The default layout with an invalid form -->
<form>
  <div class="nonFieldErrors">
    <ul class="errorlist">
      <li>Sorry, this sample form never validates!</li>
    </ul>
  </div>

  <div class="formItem required subject">
    <label for="id_subject" class=" required">Subject</label>
    <input id="id_subject" type="text" name="subject" value="test" maxlength="100" />
  </div>
  
  <div class="formItem hasErrors required message">
    <ul class="errorlist">
      <li>This field is required.</li>
    </ul>
    <label for="id_message" class=" required">Message</label>
    <input type="text" name="message" id="id_message" />
  </div>
  
  <div class="formItem hasErrors required sender">
    <ul class="errorlist">
      <li>This field is required.</li>
    </ul>
    <label for="id_sender" class=" required">Sender</label>
    <input type="text" name="sender" id="id_sender" />
  </div>
  
  <div class="formItem cc_myself">
    <label for="id_cc_myself" class="">Cc myself</label>
    <input type="checkbox" name="cc_myself" id="id_cc_myself" />
    <p class="help">Send a copy of the message to the sender.</p>
  </div>
  
  <input type="submit">
</form>

<!-- Use a wrong layout => fallback to default layout -->
<form>
  <div class="formItem required subject">
    <label for="id_subject" class=" required">Subject</label>
    <input id="id_subject" type="text" name="subject" maxlength="100" />
  </div>
  
  <div class="formItem required message">
    <label for="id_message" class=" required">Message</label>
    <input type="text" name="message" id="id_message" />
  </div>
  
  <div class="formItem required sender">
    <label for="id_sender" class=" required">Sender</label>
    <input type="text" name="sender" id="id_sender" />
  </div>
  
  <div class="formItem cc_myself">
    <label for="id_cc_myself" class="">Cc myself</label>
    <input type="checkbox" name="cc_myself" id="id_cc_myself" />
    <p class="help">Send a copy of the message to the sender.</p>
  </div>
  
  <input type="submit">
</form>

<!-- Use another layout (it says "Hello") -->
<form>
  <p>Hello form!</p>
  <p>Hello label!</p>
  <p>Hello field!</p>
  <p>Hello label!</p>
  <p>Hello field!</p>
  <p>Hello label!</p>
  <p>Hello field!</p>
  <p>Hello label!</p>
  <p>Hello field!</p>
</form>