Example #1
0
 function CreateForm()
 {
     $form1 = new jForm();
     $firstname = new jFormInput($form1, "Name");
     $firstname->SetDescription("Your first name.");
     $lastname = new jFormInput($form1, "Lastname");
     $username = new jFormInputUsername($form1, "Username");
     $gender = new jFormRadio($form1, "Gender", array(1 => "Male", 2 => "Female"));
     $education = new jFormDropdown($form1, "Education", array("High-school", "Bachelors", "Masters", "PhD"));
     $city = new jFormInput($form1, "City");
     $city->SetValidation("/^.{1,20}\$/");
     $address = new jFormInput($form1, "Address");
     $address->SetStyle("width:400px");
     $address->SetValidation("/^.{10,100}\$/");
     $address->SetDescription("Provide valid address, and a postal one.");
     $postalCode = new jFormInputNumber($form1, "Postal Code", 10, 10);
     $birthdate = new jFormInputDate($form1, "Birthdate");
     $mobile = new jFormInputNumber($form1, "Mobile", 8, 20);
     $email = new jFormInputEmail($form1, "E-Mail");
     $textarea = new jFormTextarea($form1, "Comments");
     $textarea->SetStyle("width:250px;min-height:100px;");
     $captcha = new jFormCaptcha($form1);
     $form1_submit = new jFormSubmit($form1, "Create");
     return $form1;
 }
Example #2
0
 function __construct(jWidget $Parent, $Label = null, $minLength = 0, $maxLength = -1)
 {
     parent::__construct($Parent, $Label);
     if ($maxLength === -1) {
         $maxLength = 4096;
     }
     $this->SetValidation('/^[0-9]{' . $minLength . ',' . $maxLength . '}$/');
 }
Example #3
0
 function __construct(jWidget $Parent, $Label = null)
 {
     parent::__construct($Parent, $Label);
     $this->SetValidation('/^\\d{4}-\\d{2}-\\d{2}$/');
     $this->SetDescription($this->Description . " Enter date in YYYY-MM-DD format.");
 }
Example #4
0
 function __construct(jWidget $Parent, $Label = null)
 {
     parent::__construct($Parent, $Label);
     $this->SetValidation('/^[a-zA-Z0-9.!#$%&\'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/');
 }
Example #5
0
 function __construct(jWidget $Parent, $Label = null, $MinLength = 3)
 {
     parent::__construct($Parent, $Label);
     $this->SetValidation('/^[a-zA-Z][a-zA-Z0-9_]{' . ($MinLength - 1) . ',}$/');
 }