Game server and admin dashboard for TerranQuest.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

form.php 1007B

1234567891011121314151617181920212223242526
  1. <?php
  2. /*
  3. * This Source Code Form is subject to the terms of the Mozilla Public
  4. * License, v. 2.0. If a copy of the MPL was not distributed with this
  5. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  6. */
  7. /*
  8. * This file demonstrates creating a form with the FormBuilder class.
  9. */
  10. $form = new FormBuilder("Sample Form", "fas fa-code", "", "GET");
  11. $form->setID("sampleform");
  12. $form->addHiddenInput("page", "form");
  13. $form->addInput("name", "John", "text", true, null, null, "Your name", "fas fa-user", 6, 5, 20, "John(ny)?|Steve", "Invalid name, please enter John, Johnny, or Steve.");
  14. $form->addInput("location", "", "select", true, null, ["1" => "Here", "2" => "There"], "Location", "fas fa-map-marker");
  15. $form->addInput("textbox", "Hello world", "textarea", true, null, null, "Text area", "fas fa-font");
  16. $form->addInput("box", "1", "checkbox", true, null, null, "I agree to the terms of service");
  17. $form->addButton("Submit", "fas fa-save", null, "submit", "savebtn");
  18. $form->generate();