PHP Classes
Icontem

File: example_accesskeys.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Thiemo Mättig  >  TM::Apeform  >  example_accesskeys.php  
File: example_accesskeys.php
Role: Example script
Content type: text/plain
Description: How to automatically create accesskey attributes
Class: TM::Apeform
A very abstract web form builder and processor
 

Contents

Class file image Download
<?php

/**
 * Accesskeys example. Shows mixed use of user defined and automatically created
 * accesskey attributes.
 *
 * @author Thiemo Mättig (http://maettig.com/)
 */

require_once("Apeform.class.php");
$form = new Apeform();

$form->autoAccesskeys true;
$form->templates['accesskey'] = '<em class="accesskey">{accesskey}</em>';

$form->header("Some example");
$form->staticText("Some example""""Some example");
$form->text("Some example");
$form->password("User defined <u>k</u>ey");
$form->error("Error message inherits accesskey");
$form->textarea("Other example");
$form->checkbox("Some example");
$form->checkbox("""""Some example");
$form->checkbox("Some example""""Some example");
$form->checkbox("Some example""""Aaa|Bbb|Ccc");
$form->radio("Some example""""Aaa|Bbb|Ccc");
$form->select("Some example""""Aaa|Bbb|Ccc");
$form->submit("Submit accesskey example");

?>

<style type="text/css">
label{
    background-color:#FEC;
    cursor:hand;
}
label:hover{
    background-color:#FD0;
}
.accesskey{
    background-color:#FD0;
    color:#900;
    font-style:normal;
    font-weight:bold;
    text-decoration:underline;
}
</style>

<?$form->display()?>

<ul>
<li>In Internet Explorer and Firefox press Alt+character.</li>
<li>In Opera press Shift+Esc and then the character.</li>
</ul>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products