Proposal for "HTML_QuickForm_DHTMLRulesTableless"

» Metadata » Status
» Description
DHTMLRules for HTML_QuickForm_Renderer_Tableless

This is a replacement for the default JavaScript alert window that opens when there are errors in a form and client-side validation is enabled. It is an extension for my other QuickForm proposal: HTML_QuickForm_Renderer_Tableless.

The code is adopted from Justin Patrin who wrote these DHTMLRules stuff for the default HTML_QuickForm renderer. As there are table tags being used, this won't work with the tableless renderer.

The error messages can be shown either onSubmit (default case) or onBlur/onChange for every single element (see below on how to enable this).

Changes since version 0.1.0:

  1. removed HTML_QuickForm dependency because it is already given through the dependency on HTML_QuickForm_Renderer_Tableless
  2. replaced header comment blocks with the new format


Usage:

<?php
require_once 'HTML/QuickForm/DHTMLRulesTableless.php';
$form = new HTML_QuickForm_DHTMLRulesTableless(...);
$renderer =& new HTML_QuickForm_Renderer_Tableless();
// usual code, e.g. new form fields, rules, ...
$form->getValidationScript(); // add this if you want the error message appear
// onBlur / onChange
echo $form->display();
?>


Example (Source): A simple contact form using the Tableless renderer and the DHTMLRules.
http://www.markwiesemann.de/php/DHTMLRules/contact_dhtmlrules.php
» Dependencies » Links
  • HTML_QuickForm_Renderer_Tableless >= 0.2.3
» Timeline » Changelog
  • First Draft: 2006-06-18
  • Proposal: 2006-06-18
  • Call for Votes: 2006-07-03
  • Mark Wiesemann
    [2006-06-20 20:40 UTC]

    - removed HTML_QuickForm dependency because it is already given through the dependency on HTML_QuickForm_Renderer_Tableless
    - replaced header comment blocks with the new format
  • Mark Wiesemann
    [2006-06-25 14:25 UTC]

    This is not a new release but I've updated the online example and the usage code in the proposal to relect the latest changes from my HTML_QuickForm_Renderer_Tableless proposal.