disabledFormElementsTest.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. require_once("../xajax.inc.php");
  3. function testForm($formData)
  4. {
  5. $objResponse = new xajaxResponse();
  6. $objResponse->addAlert("formData: " . print_r($formData, true));
  7. $objResponse->addAssign("submittedDiv", "innerHTML", nl2br(print_r($formData, true)));
  8. return $objResponse->getXML();
  9. }
  10. $xajax = new xajax();
  11. //$xajax->debugOn();
  12. $xajax->registerFunction("testForm");
  13. $xajax->processRequests();
  14. ?>
  15. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  16. "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
  17. <html xmlns="http://www.w3.org/1999/xhtml">
  18. <head>
  19. <title>Disabled Form Elements Test | xajax Tests</title>
  20. <?php $xajax->printJavascript("../") ?>
  21. </head>
  22. <body>
  23. <h2><a href="index.php">xajax Tests</a></h2>
  24. <h1>Disabled Form Elements Test</h1>
  25. <form id="testForm1" onsubmit="return false;">
  26. <p><input type="text" id="textBox1" name="textBox1" value="This is enabled" /></p>
  27. <p><input type="text" id="textBox2" name="textBox2" disabled="true" value="This is disabled" /></p>
  28. <p><input type="submit" value="Submit Normal" onclick="xajax_testForm(xajax.getFormValues('testForm1')); return false;" /></p>
  29. <p><input type="submit" value="Submit Everything" onclick="xajax_testForm(xajax.getFormValues('testForm1', true)); return false;" /></p>
  30. </form>
  31. <div id="submittedDiv"></div>
  32. </body>
  33. </html>