本文整理汇总了PHP中ZendX_JQuery_Form_Element_DatePicker::setRequired方法的典型用法代码示例。如果您正苦于以下问题:PHP ZendX_JQuery_Form_Element_DatePicker::setRequired方法的具体用法?PHP ZendX_JQuery_Form_Element_DatePicker::setRequired怎么用?PHP ZendX_JQuery_Form_Element_DatePicker::setRequired使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZendX_JQuery_Form_Element_DatePicker
的用法示例。
在下文中一共展示了ZendX_JQuery_Form_Element_DatePicker::setRequired方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('id', 'formid');
$this->setAttrib('name', 'holidaygroups');
$id = new Zend_Form_Element_Hidden('id');
$holidayname = new Zend_Form_Element_Text('holidayname');
$holidayname->setAttrib('maxLength', 20);
$holidayname->addFilter(new Zend_Filter_StringTrim());
$holidayname->setRequired(true);
$holidayname->addValidator('NotEmpty', false, array('messages' => 'Please enter holiday.'));
$holidayname->addValidator("regex", true, array('pattern' => '/^[a-zA-Z0-9.\\- ?]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid holiday.')));
$groupid = new Zend_Form_Element_Multiselect('groupid');
$groupid->setAttrib('class', 'selectoption');
$groupid->setRegisterInArrayValidator(false);
$groupid->setRequired(true);
$groupid->addValidator('NotEmpty', false, array('messages' => 'Please select holiday group.'));
$holiday_date = new ZendX_JQuery_Form_Element_DatePicker('holidaydate');
$holiday_date->setAttrib('readonly', 'true');
$holiday_date->setAttrib('onfocus', 'this.blur()');
$holiday_date->setOptions(array('class' => 'brdr_none'));
$holiday_date->setRequired(true);
$holiday_date->addValidator('NotEmpty', false, array('messages' => 'Please select date.'));
$description = new Zend_Form_Element_Textarea('description');
$description->setAttrib('rows', 10);
$description->setAttrib('cols', 50);
$description->setAttrib('maxlength', '200');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$submit->setLabel('Save');
$this->addElements(array($id, $holidayname, $groupid, $holiday_date, $description, $submit));
$this->setElementDecorators(array('ViewHelper'));
$this->setElementDecorators(array('UiWidgetElement'), array('holidaydate'));
}
示例2: __construct
public function __construct($minimumDeposit)
{
parent::__construct($minimumDeposit);
$savings_amount = new Zend_Form_Element_Text('savings_amount');
$savings_amount->addValidators(array(array('Float'), array('GreaterThan', false, array($minimumDeposit - 0.0001, 'messages' => array('notGreaterThan' => 'Minimum
Amount To open a savings account =' . $minimumDeposit)))));
$savings_amount->setAttrib('class', 'txt_put');
$savings_amount->setAttrib('id', 'amount');
$savings_amount->setRequired(true);
$savings_amount->setAttrib('onchange', 'calculateTotalAmount(this.value)');
$memberfirstname = new Zend_Form_Element_MultiCheckbox('memberfirstname');
$memberfirstname->setAttrib('class', 'textfield');
$memberfirstname->setAttrib('id', 'selector');
// $memberfirstname->setRequired(true);
$date1 = new ZendX_JQuery_Form_Element_DatePicker('date1', array('label' => 'Date:'));
$date1->setAttrib('class', 'txt_put');
$date1->setJQueryParam('dateFormat', 'yy-mm-dd');
$date1->setRequired(true);
$memberId = new Zend_Form_Element_Hidden('memberId');
$Type = new Zend_Form_Element_Hidden('Type');
$productId = new Zend_Form_Element_Hidden('productId');
$typeId = new Zend_Form_Element_Hidden('typeId');
$memberTypeIdv = new Zend_Form_Element_Hidden('memberTypeIdv');
$submit = new Zend_Form_Element_Submit('Submit');
$Yes = new Zend_Form_Element_Submit('Yes');
$back = new Zend_Form_Element_Submit('Back');
$this->addElements(array($submit, $savings_amount, $memberfirstname, $memberId, $date1, $productId, $typeId, $Type, $memberTypeIdv, $back, $Yes));
}
示例3: __construct
public function __construct($minimumDeposit, $ID, $codenum)
{
parent::__construct($minimumDeposit, $ID, $codenum);
//$fieldtype,$fieldname,$table,$columnname,$cssname,$labelname,$required,$validationtype,$min,$max,$rows,$cols,$decorator,$value
$formfield = new App_Form_Field();
$amount = $formfield->field('Text', 'amount', '', '', 'txt_put', '', true, '', '', '', '', '', 0, 0);
$amount->addValidators(array(array('Float'), array('GreaterThan', false, array($minimumDeposit - 0.0001, 'messages' => array('notGreaterThan' => 'Minimum
Amount To open a savings account =' . $minimumDeposit)))));
$date = new ZendX_JQuery_Form_Element_DatePicker('date');
$date->setAttrib('class', 'txt_put');
$date->setJQueryParam('dateFormat', 'yy-mm-dd');
$date->setRequired(true);
$date->setAttrib('size', 12);
//hidden feilds
$code = $formfield->field('Hidden', 'code', '', '', '', '', false, '', '', '', '', '', 0, $codenum);
$Id = $formfield->field('Hidden', 'Id', '', '', '', '', false, '', '', '', '', '', 0, $ID);
$submit = $formfield->field('Submit', 'Submit', '', '', '', '', false, '', '', '', '', '', 0, 0);
$Yes = $formfield->field('Submit', 'Yes', '', '', '', '', false, '', '', '', '', '', 0, 0);
$back = $formfield->field('Submit', 'Back', '', '', '', '', false, '', '', '', '', '', 0, 0);
$this->addElements(array($submit, $amount, $code, $Id, $date, $back, $Yes));
if (substr(base64_decode($codenum), 4, 1) == 2 or substr(base64_decode($codenum), 4, 1) == 3) {
$group = new Zend_Form_Element_MultiCheckbox('group');
$this->addElements(array($group));
} else {
$group = 0;
}
}
示例4: __construct
public function __construct($accNum)
{
parent::__construct($accNum);
$date = new ZendX_JQuery_Form_Element_DatePicker('date');
$date->setAttrib('class', '');
$date->setRequired(true);
//$fieldtype,$fieldname,$table,$columnname,$cssname,$labelname,$required,$validationtype,$min,$max,$rows,$cols,$decorator,$value
$formfield = new App_Form_Field();
$amount = $formfield->field('Text', 'amount', '', '', 'txt_put', '', true, '', '', '', '', '', 0, '');
$graterthan = new Zend_Validate_GreaterThan(0);
$amount->setRequired(true)->addValidators(array(array('NotEmpty'), array('Float'), array($graterthan, true)));
$transactionMode = $formfield->field('Select', 'transactionMode', '', '', 'txt_put', '', true, '', '', '', '', '', 0, '');
// $transactionMode->setAttrib('onchange','toggleField();');
$transactionMode->setAttrib('class', 'paymenttype');
$transactionMode->setAttrib('id', 'paymenttype');
$othertext = $formfield->field('Text', 'othertext', '', '', 'txt_put', '', false, '', '', '', '', '', 0, '');
$transactionModeDetails = $formfield->field('Textarea', 'paymenttype_details', '', '', 'txt_put', '', false, '', '', '', 1, 20, '', 0, '');
$transactionModeDetails->setAttrib('style', 'display:none');
$description = $formfield->field('Textarea', 'description', '', '', 'txt_put', '', true, '', '', '', 2, 20, '', 0, '');
// $p = $formfield->field('Text','p','','','txt_put','','','','','','','',0,$p);
// $p->setAttrib('disable','true');
// $int = $formfield->field('Text','int','','','txt_put','','','','','','','',0,$int);
// $int->setAttrib('disable','true');
// $totalAmt = $formfield->field('Text','totalAmt','','','txt_put','','','','','','','',0,$totalAmt);
// $totalAmt->setAttrib('disable','true');
// hidden feilds
$totalamount = $formfield->field('Hidden', 'totalamount', '', '', 'total', '', false, '', '', '', '', '', 0, $accNum);
$accNum = $formfield->field('Hidden', 'accNum', '', '', 'txt_put', '', true, '', '', '', '', '', 0, $accNum);
$sms = new Zend_Form_Element_Checkbox('sms');
$submit = new Zend_Form_Element_Submit('Submit');
$submit->setAttrib('id', 'button');
$back = new Zend_Form_Element_Submit('Back');
$back->setAttrib('id', 'button2');
$this->addElements(array($date, $othertext, $amount, $description, $transactionMode, $transactionModeDetails, $submit, $accNum, $totalamount, $back, $sms));
}
示例5: __construct
public function __construct($minimumDeposit, $ID, $code, $app)
{
parent::__construct($minimumDeposit, $ID, $code, $app);
//$fieldtype,$fieldname,$table,$columnname,$cssname,$labelname,$required,$validationtype,$min,$max,$rows,$cols,$decorator,$value
$formfield = new App_Form_Field();
$amount = $formfield->field('Text', 'amount', '', '', 'txt_put', '', true, '', '', '', '', '', 0, 0);
$amount->addValidators(array(array('Float'), array('GreaterThan', false, array($minimumDeposit - 0.0001, 'messages' => array('notGreaterThan' => 'Minimum
Amount To open a savings account =' . $minimumDeposit)))));
$date = new ZendX_JQuery_Form_Element_DatePicker('date');
$date->setAttrib('class', 'txt_put');
$date->setJQueryParam('dateFormat', 'yy-mm-dd');
$date->setRequired(true);
$installments = $formfield->field('Select', 'installments', '', '', 'txt_put', '', true, '', '', '', '', '', 0, 0);
$installments->setAttrib('onchange', 'getInterests(this.value,"' . $app . '",' . base64_decode($ID) . ')');
$interest = $formfield->field('Text', 'interest', '', '', 'txt_put', '', true, '', '', '', '', '', 0, 0);
$interest->setAttrib('size', '6');
$interest->setAttrib('readonly', 'true');
$interesttype = $formfield->field('Select', 'interesttype_id', '', '', 'txt_put', '', true, '', '', '', '', '', 0, 0);
$savingAccount = $formfield->field('Select', 'savingAccount', '', '', 'txt_put', '', true, '', '', '', '', '', 0, 0);
$fundings = $formfield->field('Select', 'fundings', '', '', 'txt_put', '', true, '', '', '', '', '', 0, 0);
$fundings->addMultiOption('', 'Select...');
$fundings->addMultiOption('1', 'funders');
$fundings->addMultiOption('2', 'group');
$fundings->setAttrib('onchange', 'displayRow(this.value)');
$funders = $formfield->field('Radio', 'funders', '', '', 'txt_put', '', true, '', '', '', '', '', 0, 0);
$funders->setAttrib('size', '8');
//hidden feilds
$code = $formfield->field('Hidden', 'code', '', '', '', '', false, '', '', '', '', '', 0, $code);
$Id = $formfield->field('Hidden', 'Id', '', '', '', '', false, '', '', '', '', '', 0, $ID);
$submit = $formfield->field('Submit', 'Submit', '', '', '', '', false, '', '', '', '', '', 0, 0);
$Yes = $formfield->field('Submit', 'Yes', '', '', '', '', false, '', '', '', '', '', 0, 0);
$back = $formfield->field('Submit', 'Back', '', '', '', '', false, '', '', '', '', '', 0, 0);
$this->addElements(array($submit, $amount, $installments, $interest, $interesttype, $savingAccount, $fundings, $funders, $code, $Id, $date, $back, $Yes));
}
示例6: __construct
public function __construct($accNum)
{
parent::__construct($accNum);
$date = new ZendX_JQuery_Form_Element_DatePicker('date');
$date->setAttrib('class', 'txt_put');
$date->setJQueryParam('dateFormat', 'yy-mm-dd');
$date->setRequired(true);
$date->setAttrib('size', 12);
$date1 = new ZendX_JQuery_Form_Element_DatePicker('date1');
$date1->setAttrib('class', 'txt_put');
$date1->setJQueryParam('dateFormat', 'yy-mm-dd');
$date1->setRequired(true);
$date1->setAttrib('size', 12);
//$fieldtype,$fieldname,$table,$columnname,$cssname,$labelname,$required,$validationtype,$min,$max,$rows,$cols,$decorator,$value
$formfield = new App_Form_Field();
$amount = $formfield->field('Text', 'amount', '', '', 'txt_put', '', true, '', '', '', '', '', 0, '');
$graterthan = new Zend_Validate_GreaterThan(0);
$amount->setRequired(true)->addValidators(array(array('NotEmpty'), array('Float'), array($graterthan, true)));
$amount->setAttrib('size', 12);
$description = $formfield->field('Textarea', 'description', '', '', 'txt_put', '', true, '', '', '', 2, 15, '', 0, '');
$transactionMode = $formfield->field('Select', 'transactionMode', '', '', 'txt_put', '', true, '', '', '', '', '', 0, '');
// hidden feilds
$accNum = $formfield->field('Hidden', 'accNum', '', '', 'txt_put', '', true, '', '', '', '', '', 0, $accNum);
$sms = new Zend_Form_Element_Checkbox('sms');
$back = new Zend_Form_Element_Submit('Back');
$submit = new Zend_Form_Element_Submit('Submit');
$this->addElements(array($date, $amount, $transactionMode, $description, $submit, $accNum, $back, $sms, $date1));
}
示例7: __construct
public function __construct($recurringBeginDate, $recurringClosedDate, $recurringMinAmount, $recurringMaxAmount, $app)
{
parent::__construct($recurringBeginDate, $recurringClosedDate, $recurringMinAmount, $recurringMaxAmount, $app);
$startdate = new ZendX_JQuery_Form_Element_DatePicker('startdate');
$startdate->setAttrib('id', 'startdate');
$startdate->setAttrib('size', '8');
$startdate->setAttrib('class', '');
$startdate->setRequired(true)->addValidators(array(array('Date', true), array('Between', false, array($recurringBeginDate, $recurringClosedDate, 'messages' => array('notBetween' => 'date should be between ' . $recurringBeginDate . ' to (Closed date) ' . $recurringClosedDate)))));
$recurringamount = new Zend_Form_Element_Text('recurringamount');
$recurringamount->setRequired(true)->addValidators(array(array('Digits'), array('GreaterThan', false, array($recurringMinAmount)), array('LessThan', false, array($recurringMaxAmount)), array('NotEmpty')));
$recurringamount->setAttrib('size', '8');
$recurringperiod = new Zend_Form_Element_Text('recurringperiod');
$recurringperiod->setAttrib('id', 'recurringperiod');
$recurringperiod->setAttrib('class', 'NormalBtn');
$memberfirstname = new Zend_Form_Element_MultiCheckbox('memberfirstname');
$memberfirstname->setAttrib('class', 'textfield');
$freequencyofdeposit = new Zend_Form_Element_Select('frequencyofdeposit');
$freequencyofdeposit->addMultiOption('', 'Select...');
$freequencyofdeposit->setAttrib('class', 'NormalBtn');
$freequencyofdeposit->setAttrib('id', 'freequencyofdeposit');
$perioddescription = new Zend_Form_Element_Select('perioddescription');
$perioddescription->addMultiOption('', 'Select..');
$perioddescription->setAttrib('class', 'NormalBtn');
$perioddescription->setAttrib('id', 'perioddescription');
$perioddescription->setRequired(true);
$perioddescription->setAttrib('onchange', 'getInterests(this.value,"' . $app . '")');
$periodinterest = new Zend_Form_Element_Select('periodinterest');
$periodinterest->addMultiOption('', 'Select...');
$periodinterest->setAttrib('class', 'NormalBtn');
$periodinterest->setAttrib('id', 'periodinterest');
$periodinterest->setAttrib('size', '5');
$accountId = new Zend_Form_Element_Hidden('accountId');
$productIdss = new Zend_Form_Element_Hidden('productId');
$recurringindex = new Zend_Form_Element_Text('recurringinterest');
$recurringindex->setAttrib('id', 'recurringinterest');
$recurringindex->setAttrib('size', '8');
$recurringindex->setAttrib('class', 'NormalBtn');
$recurringindex->setAttrib('readonly', 'true');
$recurringindex->setAttrib('class', 'NormalBtn');
$recurringindex->setAttrib('readonly', 'true');
$memberTypeId = new Zend_Form_Element_Hidden('memberTypeId');
$memberId = new Zend_Form_Element_Hidden('member_id');
$productId = new Zend_Form_Element_Hidden('product_id');
$offerproductId = new Zend_Form_Element_Hidden('offerproduct_id');
$groupId = new Zend_Form_Element_Hidden('groupId');
$this->addElements(array($memberfirstname, $recurringindex, $freequencyofdeposit, $recurringperiod, $recurringamount, $startdate, $perioddescription, $periodinterest, $memberId, $productId, $offerproductId, $groupId, $memberTypeId, $accountId, $productIdss));
$period_id = new Zend_Form_Element_Hidden('period_id');
$period_id->setAttrib('id', 'period_id');
$startdate1 = new Zend_Form_Element_Hidden('startdate1');
$recurringamount1 = new Zend_Form_Element_Hidden('recurringamount1');
$perioddescription1 = new Zend_Form_Element_Hidden('perioddescription1');
$interest1 = new Zend_Form_Element_Hidden('interest1');
$Confirm = new Zend_Form_Element_Submit('Confirm');
$Confirm->setLabel('Confirm');
$Confirm->setAttrib('class', 'recurring');
$submit = new Zend_Form_Element_Submit('Submit');
$submit->setLabel('submit');
$submit->setAttrib('class', 'recurring');
$this->addElements(array($submit, $period_id, $Confirm, $startdate1, $recurringamount1, $perioddescription1, $interest1));
}
示例8: init
public function init()
{
$holidayname = new Zend_Form_Element_Text('holidayname');
$holidayname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_holidayupdates', 'holidayname'));
$holidayname->setAttrib('class', 'txt_put');
$holidayname->setRequired(true)->addValidators(array(array('NotEmpty')));
$office_id = new Zend_Form_Element_Select('office_id');
$office_id->addMultiOption('', 'Select...');
$office_id->addMultiOption('All', 'All');
$office_id->setAttrib('class', 'txt_put');
$office_id->setRequired(true)->addValidators(array(array('NotEmpty')));
$holidayupdate_id = new Zend_Form_Element_Hidden('holidayupdate_id');
$holidayfrom = new ZendX_JQuery_Form_Element_DatePicker('holidayfrom');
$holidayfrom->setAttrib('class', 'txt_put');
$holidayfrom->setJQueryParam('dateFormat', 'yy-mm-dd');
$holidayfrom->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date')));
$holidayupto = new ZendX_JQuery_Form_Element_DatePicker('holidayupto');
$holidayupto->setAttrib('class', 'txt_put');
$holidayupto->setJQueryParam('dateFormat', 'yy-mm-dd');
$holidayupto->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date')));
$repayment_date = new ZendX_JQuery_Form_Element_DatePicker('repayment_date');
$repayment_date->setAttrib('class', 'txt_put');
$repayment_date->setJQueryParam('dateFormat', 'yy-mm-dd');
$repayment_date->setRequired(true)->addValidators(array(array('NotEmpty')));
array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date'));
$submit = new Zend_Form_Element_Submit('Submit');
$submit->removeDecorator('DtDdWrapper');
$this->addElements(array($holidayname, $office_id, $holidayfrom, $holidayupto, $repayment_date, $holidayupdate_id, $submit));
}
示例9: __construct
public function __construct($loanamount)
{
Zend_Dojo::enableForm($this);
parent::__construct($loanamount);
//$fieldtype,$fieldname,$table,$columnname,$cssname,$labelname,$required,$validationtype,$min,$max,$rows,$cols,$decorator,$value
$formfield = new App_Form_Field();
$date = new ZendX_JQuery_Form_Element_DatePicker('date');
$date->setAttrib('class', 'txt_put');
$date->setJQueryParam('dateFormat', 'yy-mm-dd');
$date->setRequired(true);
$Amount = new Zend_Form_Element_Text('Amount');
$Amount->setAttrib('class', 'textfield');
$lessthan = new Zend_Validate_LessThan(array('max' => $loanamount + 1, 'inclusive' => false));
$Amount->setRequired(true)->addValidators(array(array('NotEmpty'), array('Float'), array($lessthan, true)));
$transactionMode = $formfield->field('Select', 'transactionMode', '', '', 'tmode', '', true, '', '', '', '', '', 0, '');
$etransfer = $formfield->field('Select', 'etransfer', '', '', 'etran', '', false, '', '', '', '', '', 0, '');
$etransfer->setRegisterInArrayValidator(false);
$memberid = $formfield->field('Hidden', 'memberid', '', '', 'memberclass', '', false, '', '', '', '', '', 0, '');
$membertypeid = $formfield->field('Hidden', 'membertypeid', '', '', 'membertypeclass', '', false, '', '', '', '', '', 0, '');
$pathhidden = $formfield->field('Hidden', 'pathhidden', '', '', 'pathclass', '', false, '', '', '', '', '', 0, '');
$othrtext = new Zend_Form_Element_Text('othertext');
$othrtext->setAttrib('size', 12);
$description = new Zend_Form_Element_Textarea('description');
$description->setAttrib('rows', '2');
$description->setAttrib('cols', '20');
$description->setRequired(true);
$sms = new Zend_Form_Element_Checkbox('sms');
$back = new Zend_Form_Element_Submit('Back');
$back->setAttrib('id', 'button2');
$submit = new Zend_Form_Element_Submit('Submit');
$submit->setAttrib('id', 'button');
$this->addElements(array($date, $Amount, $transactionMode, $etransfer, $othrtext, $description, $sms, $memberid, $pathhidden, $membertypeid, $submit, $back));
}
示例10: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('id', 'formid');
$this->setAttrib('name', 'emppersonaldetails');
$id = new Zend_Form_Element_Hidden('id');
$userid = new Zend_Form_Element_Hidden('user_id');
$genderid = new Zend_Form_Element_Select('genderid');
$genderid->addMultiOption('', 'Select Gender');
$genderid->setRegisterInArrayValidator(false);
$genderid->setRequired(true);
$genderid->addValidator('NotEmpty', false, array('messages' => 'Please select gender.'));
$maritalstatusid = new Zend_Form_Element_Select('maritalstatusid');
$maritalstatusid->addMultiOption('', 'Select Marital Status');
$maritalstatusid->setRegisterInArrayValidator(false);
$maritalstatusid->setRequired(true);
$maritalstatusid->addValidator('NotEmpty', false, array('messages' => 'Please select marital status.'));
$ethniccodeid = new Zend_Form_Element_Select('ethniccodeid');
$ethniccodeid->addMultiOption('', 'Select Ethnic Code');
$ethniccodeid->setLabel('Ethnic Code');
$ethniccodeid->setRegisterInArrayValidator(false);
$racecodeid = new Zend_Form_Element_Select('racecodeid');
$racecodeid->addMultiOption('', 'Select Race Code');
$racecodeid->setLabel('Race Code');
$racecodeid->setRegisterInArrayValidator(false);
$languageid = new Zend_Form_Element_Select('languageid');
$languageid->addMultiOption('', 'Select Language');
$languageid->setLabel('Language');
$languageid->setRegisterInArrayValidator(false);
$nationalityid = new Zend_Form_Element_Select('nationalityid');
$nationalityid->addMultiOption('', 'Select Nationality');
$nationalityid->setRegisterInArrayValidator(false);
$nationalityid->setRequired(true);
$nationalityid->addValidator('NotEmpty', false, array('messages' => 'Please select nationality.'));
$dob = new ZendX_JQuery_Form_Element_DatePicker('dob');
$dob->setOptions(array('class' => 'brdr_none'));
$dob->setRequired(true);
$dob->setAttrib('readonly', 'true');
$dob->setAttrib('onfocus', 'this.blur()');
$dob->addValidator('NotEmpty', false, array('messages' => 'Please select date of birth.'));
//DOB should not be current date....
$celebrated_dob = new ZendX_JQuery_Form_Element_DatePicker('celebrated_dob');
$celebrated_dob->setOptions(array('class' => 'brdr_none'));
$celebrated_dob->setAttrib('readonly', 'true');
$celebrated_dob->setAttrib('onfocus', 'this.blur()');
$bloodgroup = new Zend_Form_Element_Text('bloodgroup');
$bloodgroup->setAttrib('size', 5);
$bloodgroup->setAttrib('maxlength', 10);
/*$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$submit->setLabel('Save');*/
$submitadd = new Zend_Form_Element_Button('submitbutton');
$submitadd->setAttrib('id', 'submitbuttons');
$submitadd->setAttrib('onclick', 'validatedocumentonsubmit(this)');
$submitadd->setLabel('Save');
$this->addElements(array($id, $userid, $genderid, $maritalstatusid, $nationalityid, $ethniccodeid, $racecodeid, $languageid, $dob, $celebrated_dob, $bloodgroup, $submitadd));
$this->setElementDecorators(array('ViewHelper'));
$this->setElementDecorators(array('UiWidgetElement'), array('dob', 'celebrated_dob'));
}
示例11: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('id', 'formid');
$this->setAttrib('name', 'empjobhistory');
$id = new Zend_Form_Element_Hidden('id');
$userid = new Zend_Form_Element_Hidden('user_id');
$positionheld = new Zend_Form_Element_Select('positionheld');
$positionheld->setLabel('Position');
$positionheld->setRegisterInArrayValidator(false);
// $positionheld->setRequired(true);
// $positionheld->addValidator('NotEmpty', false, array('messages' => 'Please select position.'));
$department = new Zend_Form_Element_Select('department');
$department->setLabel('Department');
$department->setRegisterInArrayValidator(false);
// $department->setRequired(true);
// $department->addValidator('NotEmpty', false, array('messages' => 'Please select department.'));
$jobtitleid = new Zend_Form_Element_Select('jobtitleid');
$jobtitleid->setLabel('Job Title');
$jobtitleid->setRegisterInArrayValidator(false);
// $jobtitleid->setRequired(true);
// $jobtitleid->addValidator('NotEmpty', false, array('messages' => 'Please select job title.'));
$start_date = new ZendX_JQuery_Form_Element_DatePicker('start_date');
$start_date->setLabel('From');
$start_date->setOptions(array('class' => 'brdr_none'));
$start_date->setAttrib('readonly', 'true');
$start_date->setAttrib('onfocus', 'this.blur()');
$start_date->setRequired(true);
$start_date->addValidator('NotEmpty', false, array('messages' => 'Please enter start date.'));
$end_date = new ZendX_JQuery_Form_Element_DatePicker('end_date');
$end_date->setLabel('To');
$end_date->setOptions(array('class' => 'brdr_none'));
$end_date->setAttrib('readonly', 'true');
$end_date->setAttrib('onfocus', 'this.blur()');
$received_amount = new Zend_Form_Element_Text("received_amount");
$received_amount->setLabel("Amount Received");
$received_amount->setAttrib('maxLength', 10);
$received_amount->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[0-9\\.]*$/', 'messages' => array('regexNotMatch' => 'Please enter only numbers.')))));
$paid_amount = new Zend_Form_Element_Text("paid_amount");
$paid_amount->setLabel("Amount Paid");
$paid_amount->setAttrib('maxLength', 10);
$paid_amount->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[0-9\\.]*$/', 'messages' => array('regexNotMatch' => 'Please enter only numbers.')))));
$client = new Zend_Form_Element_Select('client');
$client->setLabel('Client');
$client->setRegisterInArrayValidator(false);
$client->setRequired(true);
$client->addValidator('NotEmpty', false, array('messages' => 'Please select a client.'));
$vendor = new Zend_Form_Element_Text("vendor");
$vendor->setLabel("Vendor");
$vendor->addValidator("regex", true, array('pattern' => '/^[a-zA-Z.&\\- ?]+$/', 'messages' => array('regexNotMatch' => 'Please enter a valid vendor name.')));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$submit->setLabel('Save');
$this->addElements(array($id, $userid, $positionheld, $jobtitleid, $department, $start_date, $end_date, $received_amount, $paid_amount, $client, $vendor, $submit));
$this->setElementDecorators(array('ViewHelper'));
$this->setElementDecorators(array('UiWidgetElement'), array('start_date', 'end_date'));
}
示例12: __construct
public function __construct($options = null)
{
Zend_Dojo::enableForm($this);
parent::__construct($options);
$creditline_id = new Zend_Form_Element_Text('creditline_id');
$institution_id = new Zend_Form_Element_Text('institution_id');
$institutionName = new Zend_Form_Element_Select('institutionname');
$institutionName->setAttrib('class', 'txt_put');
$institutionName->setAttrib('id', 'institutionname');
$institutionName->setLabel('institutionname')->setRequired(true);
$institutionName->addMultiOption('', 'Select...');
$institutionName->setAttrib('onchange', 'getState(this.value)');
$institutionNames = new Zend_Form_Element_Text('institutionnames');
$institutionNames->setAttrib('class', 'txt_put');
$institutionNames->setAttrib('readonly', 'true');
$instituteamount = new Zend_Form_Element_Text('instituteamount');
$instituteamount->setAttrib('class', 'txt_put');
$instituteamount->setAttrib('readonly', 'true');
$institutionamount = new Zend_Form_Element_Text('institutionamount');
$institutionamount->setAttrib('class', 'txt_put');
$institutionamount->setAttrib('readonly', 'true');
$maxcreditlinelimit = new Zend_Form_Element_Text('maxcreditlinelimit');
$maxcreditlinelimit->setAttrib('class', 'txt_put');
$maxcreditlinelimit->setAttrib('readonly', 'true');
$creditlinename = new Zend_Form_Element_Text('creditlinename');
$creditlinename->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_creditlineinformation', 'creditlinename'));
$creditlinename->setAttrib('class', 'txt_put');
$creditlinename->setAttrib('id', 'creditlinename');
$creditlinename->setLabel('creditlinename')->setRequired(true)->addValidators(array(array('NotEmpty')));
$creditlineshortname = new Zend_Form_Element_Text('creditline_shortname');
$creditlineshortname->setAttrib('class', 'txt_put');
$creditlineshortname->setAttrib('id', 'creditline_shortname');
$creditlineshortname->setLabel('creditline_shortname')->setRequired(true)->addValidators(array('NotEmpty'));
$creditlineamount = new Zend_Form_Element_Text('creditlineamount');
$creditlineamount->setAttrib('class', 'txt_put');
$creditlineamount->setAttrib('id', 'creditlineamount');
$creditlineamount->setRequired(true)->addValidators(array(array('NotEmpty'), array('Float')));
$creditlineinterest = new Zend_Form_Element_Text('creditlineinterest');
$creditlineinterest->setAttrib('class', 'txt_put');
$creditlineinterest->setAttrib('id', 'creditlineinterest');
$creditlineinterest->setRequired(true)->addValidators(array(array('NotEmpty'), array('stringLength', false, array(1, 3)), array('Digits')));
$creditlinefrom = new ZendX_JQuery_Form_Element_DatePicker('creditline_beginingdate');
$creditlinefrom->setJQueryParam('dateFormat', 'yy-mm-dd');
$creditlinefrom->setRequired(true)->addValidators(array(array('Date')));
$creditlinefrom->setAttrib('class', 'txt_put');
$creditlinefrom->setAttrib('id', 'creditline_beginingdate');
$creditlineto = new ZendX_JQuery_Form_Element_DatePicker('creditline_closingdate');
$creditlineto->setJQueryParam('dateFormat', 'yy-mm-dd');
$creditlineto->setRequired(true)->addValidators(array(array('Date')));
$creditlineto->setAttrib('class', 'txt_put');
$creditlineto->setAttrib('id', 'creditline_closingdate');
$submit = new Zend_Form_Element_Submit('Submit');
$submit->setAttrib('class', 'officesubmit');
$submit->setlabel('Submit');
$this->addElements(array($creditline_id, $institutionName, $creditlinename, $creditlineshortname, $creditlineamount, $creditlineinterest, $creditlinefrom, $creditlineto, $submit, $institutionamount, $instituteamount, $institutionNames, $institution_id, $maxcreditlinelimit));
}
示例13: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('id', 'formid');
$this->setAttrib('name', 'educationdetails');
$this->setAttrib('action', DOMAIN . 'educationdetails/addpopup/');
$id = new Zend_Form_Element_Hidden('id');
$user_id = new Zend_Form_Element_Hidden('user_id');
$educationlevel = new Zend_Form_Element_Select('educationlevel');
$educationlevel->setLabel("Education Level");
$educationlevel->setRegisterInArrayValidator(false);
$educationlevel->setRequired(true);
$educationlevel->addValidator('NotEmpty', false, array('messages' => 'Please select educational level.'));
//institution_name ...
$institution_name = new Zend_Form_Element_Text('institution_name');
$institution_name->addFilter(new Zend_Filter_StringTrim());
$institution_name->setRequired(true);
$institution_name->setAttrib("maxlength", 50);
$institution_name->addValidator('NotEmpty', false, array('messages' => 'Please enter institution name.'));
$institution_name->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[a-zA-Z\\s]+$/i', 'messages' => array('regexNotMatch' => 'Please enter only alphabets.')))));
//course ...
$course = new Zend_Form_Element_Text('course');
$course->addFilter(new Zend_Filter_StringTrim());
$course->setRequired(true);
$course->setAttrib("maxlength", 50);
$course->addValidator('NotEmpty', false, array('messages' => 'Please enter course name.'));
$course->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[a-zA-Z0-9\\-\\.\\s]+$/i', 'messages' => array('regexNotMatch' => 'Please enter valid course name.')))));
//from_date..
$from_date = new ZendX_JQuery_Form_Element_DatePicker('from_date');
$from_date->setOptions(array('class' => 'brdr_none'));
$from_date->setRequired(true);
$from_date->setAttrib('readonly', 'true');
$from_date->setAttrib('onfocus', 'this.blur()');
$from_date->addValidator('NotEmpty', false, array('messages' => 'Please select from date.'));
//to_date
$to_date = new ZendX_JQuery_Form_Element_DatePicker('to_date');
$to_date->setOptions(array('class' => 'brdr_none'));
$to_date->setRequired(true);
$to_date->setAttrib('readonly', 'true');
$to_date->setAttrib('onfocus', 'this.blur()');
$to_date->addValidator('NotEmpty', false, array('messages' => 'Please select to date.'));
// percentage...
$percentage = new Zend_Form_Element_Text('percentage');
$percentage->addFilter(new Zend_Filter_StringTrim());
$percentage->setRequired(true);
$percentage->setAttrib("maxlength", 2);
$percentage->addValidator('NotEmpty', false, array('messages' => 'Please enter percentage.'));
$percentage->addValidator("regex", true, array('pattern' => '/^[0-9]+$/', 'messages' => array('regexNotMatch' => 'Please enter only numbers.')));
//Form Submit....
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$submit->setLabel('Save');
$this->addElements(array($id, $user_id, $educationlevel, $from_date, $to_date, $percentage, $course, $institution_name, $submit));
$this->setElementDecorators(array('ViewHelper'));
$this->setElementDecorators(array('UiWidgetElement'), array('from_date', 'to_date'));
}
示例14: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('id', 'formid');
$this->setAttrib('name', 'trainingandcertificationdetails');
$id = new Zend_Form_Element_Hidden('id');
$user_id = new Zend_Form_Element_Hidden('user_id');
//course_name ...
$course_name = new Zend_Form_Element_Text('course_name');
$course_name->addFilter(new Zend_Filter_StringTrim());
$course_name->setRequired(true);
$course_name->setAttrib('maxLength', 50);
$course_name->addValidator('NotEmpty', false, array('messages' => 'Please enter course name.'));
$course_name->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[a-zA-Z0-9\\-\\s]+$/i', 'messages' => array('regexNotMatch' => 'Please enter valid course name.')))));
// course_level...
$course_level = new Zend_Form_Element_Text('course_level');
$course_level->addFilter(new Zend_Filter_StringTrim());
$course_level->setRequired(true);
$course_level->setAttrib('maxLength', 50);
$course_level->addValidator('NotEmpty', false, array('messages' => 'Please enter course level.'));
$course_level->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[a-zA-Z0-9\\.\\-\\s]+$/i', 'messages' => array('regexNotMatch' => 'Please enter valid course level.')))));
//issued_date
$issued_date = new ZendX_JQuery_Form_Element_DatePicker('issued_date');
$issued_date->setOptions(array('class' => 'brdr_none'));
$issued_date->setAttrib('readonly', 'true');
$issued_date->setAttrib('onfocus', 'this.blur()');
// description ....
$description = new Zend_Form_Element_Textarea('description');
$description->setAttrib('rows', 10);
$description->setAttrib('cols', 50);
//course_offered_by ....
$course_offered_by = new Zend_Form_Element_Text('course_offered_by');
$course_offered_by->addFilter(new Zend_Filter_StringTrim());
$course_offered_by->setRequired(true);
$course_offered_by->setAttrib('maxLength', 50);
$course_offered_by->addValidator('NotEmpty', false, array('messages' => 'Please enter course offered by.'));
$course_offered_by->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[a-zA-Z0-9\\-\\s]+$/i', 'messages' => array('regexNotMatch' => 'Please enter valid name.')))));
//Referer mobile number ....
$certification_name = new Zend_Form_Element_Text('certification_name');
$certification_name->addFilter(new Zend_Filter_StringTrim());
$certification_name->setAttrib('maxLength', 50);
$certification_name->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[a-zA-z0-9\\-\\#\\.\\s]+$/i', 'messages' => array('regexNotMatch' => 'Please enter valid certification name.')))));
$certificationNameStr = Zend_Controller_Front::getInstance()->getRequest()->getParam('certification_name', null);
//If certification is done then should enter the issue date......
if ($certificationNameStr != "") {
$issued_date->setRequired(true);
$issued_date->addValidator('NotEmpty', false, array('messages' => 'Please select date.'));
}
//Form Submit....
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$submit->setLabel('Save');
$this->addElements(array($id, $user_id, $certification_name, $course_offered_by, $description, $issued_date, $course_level, $course_name, $submit));
$this->setElementDecorators(array('ViewHelper'));
$this->setElementDecorators(array('UiWidgetElement'), array('issued_date'));
}
示例15: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('id', 'formid');
$this->setAttrib('name', 'currencyconverter');
$id = new Zend_Form_Element_Hidden('id');
$id_val = Zend_Controller_Front::getInstance()->getRequest()->getParam('id');
$basecurrency = new Zend_Form_Element_Select('basecurrency');
$basecurrency->setAttrib('class', 'selectoption');
$basecurrency->addMultiOption('', 'Select base currency');
$basecurrency->setAttrib('onchange', 'displayTargetCurrency(this)');
$basecurrency->setRegisterInArrayValidator(false);
$basecurrency->setRequired(true);
$basecurrency->addValidator('NotEmpty', false, array('messages' => 'Please select base currency.'));
$targetcurrency = new Zend_Form_Element_Select('targetcurrency');
$targetcurrency->setAttrib('class', 'selectoption');
$targetcurrency->addMultiOption('', 'Select target currency');
$targetcurrency->setRegisterInArrayValidator(false);
$targetcurrency->setRequired(true);
$targetcurrency->addValidator('NotEmpty', false, array('messages' => 'Please select target currency.'));
if ($id_val == '') {
$targetcurrency->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_currencyconverter', 'field' => 'targetcurrency', 'exclude' => 'basecurrency="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('basecurrency') . '" AND targetcurrency="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('targetcurrency') . '" and isactive=1')));
$targetcurrency->getValidator('Db_NoRecordExists')->setMessage('Currency combination already exists.');
}
$exchangerate = new Zend_Form_Element_Text("exchangerate");
$exchangerate->setAttrib('maxLength', 15);
$exchangerate->addFilter(new Zend_Filter_StringTrim());
$exchangerate->setRequired(true);
$exchangerate->addValidator('NotEmpty', false, array('messages' => 'Please enter exchange rate.'));
$exchangerate->addValidator("regex", false, array("/^[0-9]+(\\.[0-9]{1,6})?\$/", "messages" => "Please enter valid exchange rate."));
$start_date = new ZendX_JQuery_Form_Element_DatePicker('start_date');
$start_date->setAttrib('readonly', 'true');
$start_date->setAttrib('onfocus', 'this.blur()');
$start_date->setOptions(array('class' => 'brdr_none'));
$start_date->setRequired(true);
$start_date->addValidator('NotEmpty', false, array('messages' => 'Please select start date.'));
$end_date = new ZendX_JQuery_Form_Element_DatePicker('end_date');
$end_date->setAttrib('readonly', 'true');
$end_date->setAttrib('onfocus', 'this.blur()');
$end_date->setOptions(array('class' => 'brdr_none'));
$end_date->setRequired(true);
$end_date->addValidator('NotEmpty', false, array('messages' => 'Please select end date.'));
$description = new Zend_Form_Element_Textarea('description');
$description->setAttrib('rows', 10);
$description->setAttrib('cols', 50);
$description->setAttrib('maxlength', '200');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$submit->setLabel('Save');
$this->addElements(array($id, $basecurrency, $targetcurrency, $exchangerate, $start_date, $end_date, $description, $submit));
$this->setElementDecorators(array('ViewHelper'));
$this->setElementDecorators(array('UiWidgetElement'), array('start_date', 'end_date'));
}