class ulogonForm extends HTML_QuickForm { function ulogonForm($formname = '', $submit = true) { parent::HTML_QuickForm($formName); //$this->addElement('text','menu','','logon'); $this->addElement('text','id','ログオンID',array('size'=>8)); $this->addElement('text','pw','パスワード',array('size'=>8)); $this->addElement('hidden','mn','logon'); if($submit){ $this->addElement('submit','submit','送信'); } $this->applyFilter('__ALL__','trim'); $this->addRule('id','ログオンIDを入力して下さい','required',null); $this->addRule('pw','パスワードを入力して下さい','required',null); } } $form = new uLogonForm('form'); if ($form->validate()) { // 入力チェックOKの時のログオン処理 } $result = $form->toHTML(); |