Example #1
0
    label, textarea { display: block; }
  </style>
</head>
<body>
  <h1>Contact Form Example</h1>

  <?php 
if ($form->submitted()) {
    ?>
    <p>Thank you for contacting us!</p>
  <?php 
} else {
    ?>

    <?php 
    if ($form->hasValidationErrors()) {
        ?>
      <p><strong>Some errors were detected in your form:</strong></p>
      <ul>
        <?php 
        foreach ($form->validationErrors() as $error) {
            ?>
          <li><?php 
            echo $error;
            ?>
</li>
        <?php 
        }
        ?>
      </ul>
    <?php