previousHTML_QuickForm_DHTMLRulesTableless (Previous) (Next) HTML_QuickForm_advmultiselectnext

View this page in Last updated: Sun, 21 Jun 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

使用法

このパッケージを使用するには、単にこのようにすればいいだけです。

<?php
require_once 'HTML/QuickForm.php';
require_once 
'HTML/QuickForm/DHTMLRulesTableless.php';
require_once 
'HTML/QuickForm/Renderer/Tableless.php';

$form = new HTML_QuickForm_DHTMLRulesTableless(...);
$renderer = new HTML_QuickForm_Renderer_Tableless();

// ここに通常のコードを書きます。
// たとえばフォームのフィールドや規則など……。

$form->accept($renderer);
echo 
$renderer->toHtml();
?>

先ほどテーブルレスレンダラのところで説明したように、 完全に妥当な XHTML コードを出力させるには以下の行を追加しなければなりません。

<?php
$form
->removeAttribute('name');
?>
Note: $form の使用方法は、標準の HTML_QuickForm パッケージと同じです。まったく違いはありません。

"onBlur" イベントや "onChange" イベントでの検証を有効にするには、 $form->accept($renderer); をコールする前に次の行を追加します。

<?php
$form
->getValidationScript();
?>
previousHTML_QuickForm_DHTMLRulesTableless (Previous) (Next) HTML_QuickForm_advmultiselectnext

Download Documentation Last updated: Sun, 21 Jun 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.