// Set url $newForm->setUrl($SERVER_HOST . $SELF_PATH . 'defaulticon.php'); // Set Form header $formhead = 'Shipping Details'; $newForm->setFormHeader($formhead, 'ui-icon-mail-closed'); // Set parameters $jqformparams = array(); // Set SQL Command, table, keys $newForm->table = 'orders'; $newForm->setPrimaryKeys('OrderID'); $newForm->serialKey = true; // Set Form layout $newForm->setColumnLayout('twocolumn'); $newForm->setTableStyles('width:580px;', '', ''); // Add elements $newForm->addElement('OrderID', 'hidden', array('label' => 'OrderID', 'id' => 'newForm_OrderID')); $newForm->addElement('ShipName', 'text', array('label' => 'Name', 'maxlength' => '40', 'style' => 'width:98%;', 'id' => 'newForm_ShipName')); $newForm->addElement('ShipAddress', 'text', array('label' => 'Address', 'maxlength' => '60', 'style' => 'width:98%;', 'id' => 'newForm_ShipAddress')); $newForm->addElement('ShipCity', 'text', array('label' => 'City', 'maxlength' => '15', 'size' => '20', 'id' => 'newForm_ShipCity')); $newForm->addElement('ShipPostalCode', 'text', array('label' => 'PostalCode', 'maxlength' => '10', 'size' => '20', 'id' => 'newForm_ShipPostalCode')); $newForm->addElement('ShipCountry', 'text', array('label' => 'Country', 'maxlength' => '15', 'size' => '20', 'id' => 'newForm_ShipCountry')); $newForm->addElement('Freight', 'number', array('label' => 'Freight', 'id' => 'newForm_Freight')); $elem_8[] = $newForm->createElement('newSubmit', 'submit', array('value' => 'Submit')); $newForm->addGroup("newGroup", $elem_8, array('style' => 'text-align:right;', 'id' => 'newForm_newGroup')); // Add events // Add ajax submit events $newForm->setAjaxOptions(array('iframe' => false, 'forceSync' => false)); // Demo mode - no input $newForm->demo = true; // Render the form echo $newForm->renderForm($jqformparams);
// Set url $newForm->setUrl($SERVER_HOST . $SELF_PATH . 'jsevent.php'); // Set Form header $formhead = 'Shipping Details'; $newForm->setFormHeader($formhead, 'ui-icon-mail-closed'); // Set parameters $jqformparams = array(); // Set SQL Command, table, keys $newForm->table = 'orders'; $newForm->setPrimaryKeys('OrderID'); $newForm->serialKey = true; // Set Form layout $newForm->setColumnLayout('twocolumn'); $newForm->setTableStyles('width:580px;', '', ''); // Add elements $newForm->addElement('OrderID', 'hidden', array('label' => 'OrderID', 'id' => 'newForm_OrderID')); $newForm->addElement('ShipName', 'text', array('label' => 'Name', 'maxlength' => '40', 'style' => 'width:98%;', 'id' => 'newForm_ShipName')); $newForm->addElement('ShipAddress', 'text', array('label' => 'Address', 'maxlength' => '60', 'style' => 'width:98%;', 'id' => 'newForm_ShipAddress')); $newForm->addElement('ShipCity', 'text', array('label' => 'City', 'maxlength' => '15', 'size' => '20', 'id' => 'newForm_ShipCity')); $newForm->addElement('ShipPostalCode', 'text', array('label' => 'PostalCode', 'maxlength' => '10', 'size' => '20', 'id' => 'newForm_ShipPostalCode')); $newForm->addElement('ShipCountry', 'text', array('label' => 'Country', 'maxlength' => '15', 'size' => '20', 'id' => 'newForm_ShipCountry')); $newForm->addElement('Freight', 'number', array('label' => 'Freight', 'id' => 'freight')); $newForm->addElement('Tax', 'number', array('label' => 'Tax', 'min' => '10', 'max' => '20', 'step' => '10', 'value' => '10', 'id' => 'tax', 'title' => 'Enter a value 10 or 20')); $newForm->addElement('Total', 'number', array('label' => 'Total', 'readonly' => '1', 'id' => 'total')); $elem_10[] = $newForm->createElement('newSubmit', 'submit', array('value' => 'Submit')); $newForm->addGroup("newGroup", $elem_10, array('style' => 'text-align:right;', 'id' => 'newForm_newGroup')); // Add events $onchangeFreight = <<<CHANGEFREIGHT function(event) { var fr = parseFloat(\$("#freight").val());
// Set url $newForm->setUrl($SERVER_HOST . $SELF_PATH . 'html5types.php'); // Set Form header $formhead = 'Shipping Details'; $newForm->setFormHeader($formhead, 'ui-icon-mail-closed'); // Set parameters $jqformparams = array(); // Set SQL Command, table, keys $newForm->table = 'orders'; $newForm->setPrimaryKeys('OrderID'); $newForm->serialKey = true; // Set Form layout $newForm->setColumnLayout('twocolumn'); $newForm->setTableStyles('width:580px;', '', ''); // Add elements $newForm->addElement('OrderID', 'hidden', array('label' => 'OrderID', 'id' => 'newForm_OrderID')); $newForm->addElement('ShipName', 'text', array('label' => 'Name', 'maxlength' => '40', 'placeholder' => 'Enter Ship name', 'style' => 'width:98%;', 'id' => 'newForm_ShipName')); $newForm->addElement('ShipAddress', 'text', array('label' => 'Address', 'maxlength' => '60', 'placeholder' => 'Enter Ship Address', 'style' => 'width:98%;', 'id' => 'newForm_ShipAddress')); $newForm->addElement('ShipCity', 'text', array('label' => 'City', 'maxlength' => '15', 'size' => '20', 'placeholder' => 'Enter Ship City', 'id' => 'newForm_ShipCity')); $newForm->addElement('ShipPostalCode', 'text', array('label' => 'PostalCode *', 'maxlength' => '10', 'size' => '20', 'pattern' => '^[\\d]{5}(-[\\d]{4})?$', 'placeholder' => 'Enter 5 or 9 digit postal code', 'title' => 'Enter valid postal code', 'id' => 'newForm_ShipPostalCode')); $newForm->addElement('ShipCountry', 'text', array('label' => 'Country', 'maxlength' => '15', 'size' => '20', 'id' => 'newForm_ShipCountry')); $newForm->addElement('Freight', 'number', array('label' => 'Freight', 'min' => '0.1', 'max' => '40', 'step' => '0.5', 'id' => 'newForm_Freight')); $newForm->addElement('email', 'email', array('label' => 'Email ', 'style' => 'width:98%;', 'id' => 'newForm_email')); $newForm->addElement('url', 'url', array('label' => 'Company Url', 'style' => 'width:98%;', 'id' => 'newForm_url')); $elem_10[] = $newForm->createElement('newSubmit', 'submit', array('value' => 'Submit')); $newForm->addGroup("newGroup", $elem_10, array('style' => 'text-align:right;', 'id' => 'newForm_newGroup')); // Add events // Add ajax submit events $newForm->setAjaxOptions(array('dataType' => 'html', 'resetForm' => null, 'clearForm' => null, 'iframe' => false, 'forceSync' => false)); // Demo mode - no input $newForm->demo = true;
$newForm->setConnection($conn); // Set url $newForm->setUrl($SERVER_HOST . $SELF_PATH . 'selectdbstring.php'); // Set Form header $formhead = 'Shipping Details'; $newForm->setFormHeader($formhead, 'ui-icon-mail-closed'); // Set parameters $jqformparams = array(); // Set SQL Command, table, keys $newForm->table = 'orders'; $newForm->setPrimaryKeys('OrderID'); $newForm->serialKey = true; // Set Form layout $newForm->setColumnLayout('twocolumn'); // Add elements $newForm->addElement('OrderID', 'hidden', array('label' => 'OrderID', 'id' => 'newForm_OrderID')); $newForm->addElement('ShipName', 'text', array('label' => 'Name', 'maxlength' => '40', 'size' => '40', 'id' => 'newForm_ShipName')); $newForm->addElement('ShipAddress', 'text', array('label' => 'Address', 'maxlength' => '60', 'size' => '40', 'id' => 'newForm_ShipAddress')); $newForm->addElement('ShipCity', 'text', array('label' => 'City', 'maxlength' => '15', 'size' => '20', 'id' => 'newForm_ShipCity')); $newForm->addElement('ShipPostalCode', 'text', array('label' => 'PostalCode', 'maxlength' => '10', 'size' => '20', 'id' => 'newForm_ShipPostalCode')); $newForm->addElement('ShipCountry', 'select', array('label' => 'Country', 'datalist' => ' : Select Country', 'datasql' => 'SELECT ShipCountry FROM orders WHERE ShipCountry <> "" GROUP BY ShipCountry', 'id' => 'newForm_ShipCountry')); $newForm->addElement('Freight', 'number', array('label' => 'Freight', 'id' => 'newForm_Freight')); $elem_8[] = $newForm->createElement('newSubmit', 'submit', array('value' => 'Submit')); $newForm->addGroup("newGroup", $elem_8, array('style' => 'text-align:right;', 'id' => 'newForm_newGroup')); // Add events // Add ajax submit events $newForm->setAjaxOptions(array('iframe' => false, 'forceSync' => false)); // Demo mode - no input $newForm->demo = true; // Render the form echo $newForm->renderForm($jqformparams);
include_once $CODE_PATH . 'jqForm.php'; // Create instance $newForm = new jqForm('newForm', array('method' => 'post', 'id' => 'newForm')); // Set url $newForm->setUrl($SERVER_HOST . $SELF_PATH . 'defaultnodb.php'); // Set Form header // Set Form Footer // Set parameters $jqformparams = array(); // Set SQL Command, table, keys $newForm->serialKey = true; // Set Form layout $newForm->setColumnLayout('twocolumn'); $newForm->setTableStyles('width:580px;', '', ''); // Add elements $newForm->addElement('OrderID', 'hidden', array('label' => 'OrderID', 'id' => 'newForm_OrderID')); $newForm->addElement('ShipName', 'text', array('label' => 'ShipName', 'maxlength' => '40', 'style' => 'width:98%;', 'id' => 'newForm_ShipName')); $newForm->addElement('ShipAddress', 'text', array('label' => 'ShipAddress', 'maxlength' => '60', 'style' => 'width:98%;', 'id' => 'newForm_ShipAddress')); $newForm->addElement('ShipCity', 'text', array('label' => 'ShipCity', 'maxlength' => '15', 'size' => '20', 'id' => 'newForm_ShipCity')); $newForm->addElement('ShipPostalCode', 'text', array('label' => 'ShipPostalCode', 'maxlength' => '10', 'size' => '20', 'id' => 'newForm_ShipPostalCode')); $newForm->addElement('ShipCountry', 'text', array('label' => 'ShipCountry', 'maxlength' => '15', 'size' => '20', 'id' => 'newForm_ShipCountry')); $newForm->addElement('Freight', 'number', array('label' => 'Freight', 'id' => 'newForm_Freight')); $newForm->addElement('details', 'textarea', array('label' => 'Shipping details', 'rows' => '4', 'style' => 'width:98%;', 'id' => 'newForm_details')); $newForm->addElement('express', 'checkbox', array('label' => 'Express ', 'id' => 'newForm_express')); $newForm->addElement('Gender', 'radio', array('label' => 'Gender', 'value' => 'Male', 'text' => 'Male', 'id' => 'newForm_Gender')); $newForm->addElement('Gender', 'radio', array('value' => 'Female', 'text' => 'Female', 'id' => 'newForm_Gender')); $elem_12[] = $newForm->createElement('newSubmit', 'submit', array('value' => 'Submit')); $newForm->addGroup("newGroup", $elem_12, array('style' => 'text-align:right;', 'id' => 'newForm_newGroup')); // Add events // Add ajax submit events $newForm->setAjaxOptions(array('iframe' => false, 'forceSync' => false));