######################################### /* INITIALIZE THE CLASS WITH SOME OPTIONS */ $options = array('add_class_validator' => true, 'form_width' => '400px', 'labels_align' => 'right', 'spacer_height' => '10px'); require_once '../PtcForm.php'; $form = new PtcForm($options); echo '<!DOCTYPE html><html><head>'; /* (OPTIONAL) INCLUDE JS FOR JQUERY VALIDATOR AND UI STYLES PLUGINS */ //require_once("ptcforms-ui-plugins.php"); /* MINIMAL CSS FOR THE EXAMPLE */ echo '<style> body{font:normal .85em "trebuchet ms",arial,sans-serif;color:#555;} input[type=text], select, textarea{width:220px;} .errMsg{color:red;} </style>'; /* ADDING A TEXT FIELD */ $form->addElement(array('name' => 'ct_firstname', 'label' => 'Firstname:*', 'validate' => 'required')); /* ADDING A TEXT FIELD */ $form->addElement(array('name' => 'ct_lastname', 'label' => 'Lastname:*', 'validate' => 'required')); /* ADDING A TEXT FIELD */ $form->addElement(array('name' => 'ct_email', 'label' => 'Your email:*', 'validate' => array('required', 'email'))); /* ADDING A TEXT FIELD */ $form->addElement(array('name' => 'ct_phone', 'label' => 'Your phone:*', 'validate' => 'required')); /* ADDING A SELECT FIELD */ $values = array('' => 'Choose', 'enquiry' => 'Enquiry', 'information' => 'Information', 'billing' => 'Billing', 'other' => 'Other'); $form->addElement(array('type' => 'select', 'name' => 'ct_reason', 'label' => 'Contact reason:*', 'values' => $values, 'validate' => 'required')); /* ADDING A TEXTAREA FIELD */ $form->addElement(array('type' => 'textarea', 'name' => 'ct_message', 'label' => 'Write message:*', 'attributes' => array('rows' => 7), 'validate' => 'required')); /* ADDING A SUBMIT BUTTON */ $form->addElement(array('type' => 'submit', 'name' => 'ct_contact_me', 'value' => 'Submit', 'parentEl' => array('style' => 'text-align:right;'))); $err_msg = ''; $sent = false;
$_SESSION['loggedIn'] = false; /* INITIALIZE THE CLASS WITH SOME OPTIONS */ $options = array('add_class_validator' => true, 'keep_values' => false, 'labels_align' => 'right', 'form_width' => '415px', 'spacer_height' => '10px;'); require_once '../PtcForm.php'; $form = new PtcForm($options); echo '<!DOCTYPE html><html><head>'; /* (OPTIONAL) INCLUDE JS FOR JQUERY VALIDATOR AND STYLES */ //require_once("ptcforms-ui-plugins.php"); /* MINIMAL CSS FOR THE EXAMPLE */ echo '<style> body{font:normal .85em "trebuchet ms",arial,sans-serif;color:#555;} #loginForm input[type=text], input[type=password]{width:237px;} .errMsg{color:red;} </style>'; /* ADDING A TEXT FIELD */ $form->addElement(array('name' => 'lg_username', 'label' => 'Username:'******'validate' => 'required')); /* ADDING A PASSWORD FIELD */ $form->addElement(array('type' => 'password', 'name' => 'lg_password', 'label' => 'Password:'******'validate' => array('required', 'check_login'))); /* ADDING A CHECKBOX */ $checkbox = array('type' => 'checkbox', 'name' => 'lg_keep_login', 'label' => 'Remember me', 'parentEl' => array('style' => 'text-align:right;')); /* ADDING CHECKED AS ATTRIBUTE IF FORM WAS SENT */ if (isset($_POST['lg_keep_login'])) { $checkbox['attributes'] = array('checked' => true); } $form->addElement($checkbox); /* ADDING A SUBMIT BUTTON */ $form->addElement(array('type' => 'submit', 'name' => 'lg_login', 'value' => 'Login', 'parentEl' => array('style' => 'text-align:right;margin-right:5px;'), 'attributes' => array('style' => false))); /* COMPOSITE FOR CUSTOM LAYOUTS */ $form->addElement(array('type' => 'composite', 'name' => 'lg_login_box', 'values' => array('lg_keep_login', 'lg_login'), 'attributes' => array('style' => 'width:265px;float:right;'))); $err_msg = ''; if (@$_POST['lg_login']) {
*/ /* INITIALIZE THE CLASS WITH SOME OPTIONS */ $options = array('add_class_validator' => true, 'form_width' => '500px', 'spacer_height' => '10px;'); require_once '../PtcForm.php'; $form = new PtcForm($options); echo '<!DOCTYPE html><html><head>'; /* (OPTIONAL) INCLUDE JS FOR JQUERY VALIDATOR AND STYLES */ //require_once("ptcforms-ui-plugins.php"); /* MINIMAL CSS FOR THE EXAMPLE */ echo '<style> body{font:normal .85em "trebuchet ms",arial,sans-serif;color:#555;} input[type=text], input[type=password]{width:220px;} .errMsg{color:red;} </style>'; /* ADDING A SPACER */ $form->addElement(array('type' => 'custom', 'name' => 'spacer1', 'value' => $form->addSpacer('3px'))); /* ADDING A TEXT FIELD */ $form->addElement(array('name' => 'reg_name', 'label' => 'Username:*', 'validate' => 'required')); /* ADDING A PASSWORD FIELD */ $form->addElement(array('type' => 'password', 'name' => 'reg_password', 'label' => 'Password:*', 'validate' => 'required')); /* ADDING A PASSWORD FIELD */ $form->addElement(array('type' => 'password', 'name' => 'reg_password1', 'label' => 'Confirm Password:*', 'validate' => array('required', 'equalTo' => 'reg_password'))); /* ADDING A TEXT FIELD */ $form->addElement(array('type' => 'text', 'name' => 'reg_email', 'label' => 'Email Address:*', 'validate' => array("required", "email"))); /* ADDING A FIELDSET AS CONTAINER FOR THE PREVIOUS FIELDS */ $form->addElement(array('type' => 'fieldset', 'name' => 'reg_fieldset', 'label' => 'User Registration Form', 'values' => array('spacer1', 'reg_name', 'reg_password', 'reg_password1', 'reg_email'), 'attributes' => array('style' => 'padding:10px;'))); /* ADDING A RADIOGROUP */ $form->addElement(array('type' => 'radiogroup', 'name' => 'reg_newsletter', 'values' => array('yes' => 'Yes !!! (please)', 'no' => 'No (thank you)'), 'labelOptions[]' => array('align' => 'right'), 'attributes[yes]' => array('checked' => true), 'validate' => 'required')); /* ADDING A SPACER */ $form->addElement(array('type' => 'custom', 'name' => 'spacer2', 'value' => $form->addSpacer('1px'))); /* ADDING A FIELDSET AS CONTAINER FOR THE PREVIOUS FIELDS */