Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 23069 программистов и 1587 роботов. Сейчас ищут 1730 программистов ...

Introduction

Вернуться к: Introduction

Introduction

Introduction – Introduction to HTML_QuickForm_Renderer_Tableless

HTML_QuickForm_Renderer_Tableless is a replacement of the default renderer of HTML_QuickForm. It has two main goals:

Accessibility: Because of the abandonment of table tags and the addition of for attributes to the label tags and id attributes to the form elements, the generated output provides good accessibility. Challenged person might use screen readers, and unhindered persons benefit from the possibility to click on the labels to set the focus to the belonging form element.

Validity: The generated output of the renderer is fully XHTML 1.1 valid.

Usage

To use this renderer, you just need to copy (and modify if you want) the stylesheet and do something like this:

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

$form =& new HTML_QuickForm();
$renderer =& new HTML_QuickForm_Renderer_Tableless();

// usual code, e.g. new form fields, rules, ...

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

For full XHTML validity, you need to add the following line to your code:

<?php
$form
->removeAttribute('name');
?>


Вернуться к: Introduction

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware