1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
<?php
function startpage($formdata) {
$response = new xajaxResponse();
$email=$formdata['email'];
$response->alert("Email : "+$email);
$password=$formdata['password'];
$response->alert("Password : "+$password);
return $response;
}
require_once('xajax_core/xajax.inc.php');
$xajax = new xajax(); //Create the ajax object
/* register the functions */
$xajax->register(XAJAX_FUNCTION, 'startpage');
$xajax->processRequest();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<title>Questionnaire</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php $xajax->printJavascript(); ?>
</head>
<body>
<div id="block">
<form action="#" onsubmit="javascript:xajax_startpage(xajax.getFormValues(this.form)); return false;">
<label>Email:<input type="text" size="15" id="email" name="email" /></label><br />
<label>Password:<input type="text" size="15" id="password" name="password" /></label><br />
<input type="submit" value="Go" />
</form>
</div>
</body>
</html> |
Partager