1

我有员工控制器和员工模型,在员工视图中,这是 add_emp.ctp 视图。我使用对话框添加员工详细信息,所以我想在 cakephp 中使用客户端验证进行验证

<?php

echo $this->Form->create('Employee');
echo $this->Form->input('empname', array('label' => 'Employee Name','id'=>'empname'));
echo $this->Form->label('Current Address');
echo $this->Form->textarea('empadd');
echo $this->Form->input('empmobile', array('label' => 'Mobile No.'));
echo $this->Form->input('empemail', array('label' => 'Email Address'));
echo "Select Gender:";
$option =  array ("Male" => "Male", "Female" => "Female");

echo $this->Form->input('empgender', array('type' => 'radio',
                                           'options' =>  $option,
                                          'label' => true,
                                          "legend" => false
                                         )
                                    );
echo $this->Form->button('Submit', array( 'class' => 'button'));
echo $this->Html->link("Cancel", array('controller' => 'employees','action'=> 'index'), array( 'class' => 'button'));
echo $this->Form->end();
?>
4

0 回答 0