Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once( "../xajax_core/xajax.inc.php" );
- function testForm( $formData )
- {
- $objResponse=new xajaxResponse();
- $salida=$formData['textInput'];
- $objResponse->alert( "formData: " . print_r( $formData, true ) );
- $objResponse->assign( "submittedDiv", "innerHTML", $salida);
- return $objResponse;
- }
- $xajax=new xajax();
- //$xajax->configure("debug", true);
- $xajax->register(XAJAX_FUNCTION, "testForm");
- $xajax->processRequest();
- $xajax->configure('javascript URI','../');
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
- <html xmlns = "http://www.w3.org/1999/xhtml">
- <head>
- <title>Form Submission Test| xajax Tests</title>
- <style type = "text/css">
- fieldset > div
- {
- border: 1px solid gray;
- padding: 5px;
- background-color: white;
- }
- </style>
- <?php $xajax->printJavascript( "../" ) ?>
- </head>
- <body>
- <h2><a href = "index.php">xajax Tests</a></h2>
- <h1>Form Submission Test</h1>
- <div>
- <form id = "testForm1" onsubmit = "return false;">
- <fieldset style = "display:inline; background-color: rgb(230,230,230);">
- <legend>
- Test Form
- </legend>
- <div style = "margin: 3px;">
- <div>
- Text Input
- </div>
- <input type = "text" id = "textInput" name = "textInput" value = "text" />
- </div>
- <input type = "submit" value = "submit through xajax"
- onclick = "xajax_testForm(xajax.getFormValues('testForm1')); return false;" />
- </fieldset>
- </form>
- </div>
- <div id = "submittedDiv" style = " margin: 3px;">
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement