function index() { $options = array("a" => 1, "b" => 2); $this->load_library("Form", "form"); $this->form->init_form(URL . "ajax.php/form/save/", "get"); $this->form->open_table("Table title"); $this->form->add_hidden('a', 1); $this->form->add_item('text', 'name', 'text', 'description', null, 'required'); $this->form->add_item('text', 'email', 'email', 'insert your email', null, 'required,email'); $this->form->add_item('password', 'pw', 'password', 'insert your pw'); $this->form->add_item('select', 'sel', 'select', 'make your choice', null, null, array('options' => $options)); $this->form->add_item('checkbox', 'check', 'select', 'make your choice', null, null, array('options' => $options)); $this->form->add_item('textarea', 'textarea', 'textarea', 'description'); $this->form->add_item('word', 'word', 'textarea', 'description'); $this->form->add_item('file', 'file', 'filename', 'upload a file'); $this->form->add_item('yes', 'yes', 'enable', 'do you want to enable?'); $this->form->add_html('this is plain html'); $this->form->add_button(); $this->form->close_table(); $this->form->draw($use_ajax = true, $return_string = false); }
function writeSearchBar() { writeSectionHeader("Search The Nerdery"); $frm = new Form("field", "searchForm", "search.php", "runSearch"); $frm->addFormElement("search_term", "text", "Search For", "", true); $frm->method = "get"; $frm->draw(); }
?> <br> <table border="0" width="750" cellpadding="0" cellspacing="0"> <tr> <td> <?php //print_r ($_SESSION["user"]); //echo $_SESSION["user"]->userID; if ($_SESSION["user"]->signatureFile == 1) { $sig_file = "/images/signatures/" . $_SESSION["user"]->userID . ".sig"; } else { $sig_file = ""; } $frm = new Form("field", "editUser", "edit_user.php", "updateUser"); $frm->addFormElement("display_name", "text", "Display Name", $_SESSION["user"]->displayName, true); $frm->addFormElement("signature_file", "file", "Signature File", "", false); $frm->addFormElement("signature_image", "image", "Current Signature", $sig_file, false); $frm->draw(); ?> </td> </tr> </table> <?php WriteFooter(); $application->save(); ?>
function draw() { Form::draw(); }
/** * Draw the form */ function draw() { $this->title = $this->title." <i>".$this->containerName."</i>"; Form::draw(); }