<?php
require_once("HTML/QuickForm.php");
function showProcess($values){print_r($values);}
$form=new HTML_QuickForm("myForm","POST");
$form->addElement("header",NULL,"HTML_QuickFormカスタム要素");

$depart1=array("総務部","経理部","人事部","資材部");
$depart2=array(
		array("掛谷奈美","うえがき麻耶","日尾有宏","山葉寿和"),
		array("森山絵美","小田原大","佐藤匡剛"),
		array("佐藤治夫","本田将輝","山田祥寛"),
		array("鈴木次郎","中田和弘","江川栄治"));
$depart=$form->addElement("hierselect","depart","部署／部員：");
$depart->setMainOptions($depart1);
$depart->setSecOptions($depart2);


$form->addElement("advcheckbox","send1","通知：","有効",NULL,array("No","Yes"));
$form->addElement("advcheckbox","send2","通知：","有効",NULL,array(0=>'受け取らない',1=>'受け取る'));

$form->setDefaults(array('send1'=>'Yes'));
$form->setDefaults(array('send2'=>'受け取る'));

$form->addElement("submit","sbm","送信");

if($form->validate()){
	$form->freeze();
	$form->process("showProcess",FALSE);
}else{
	$form->display();
}
?>
