rendered paste body<?
ini_set("display_errors",1);
error_reporting(E_ALL ^E_NOTICE);
$core = './xajax/xajax_core';
require_once $core . '/xajax.inc.php';
$xajax = new xajax();
require_once './xajax/xajax_plugins/request/upload/upload.inc.php';
$xajax->configure("javascript URI","/upload/xajax/");
$xajax->configure("UploadProgressType","LIGHTTPD");
$xajax->register(XAJAX_FUNCTION,"test");
$xajax->processRequest();
$xajax->autoCompressJavascript(NULL,true);
function test($aFormValues) {
$objResponse = new xajaxResponse();
$objResponse->assign("results","innerHTML","woohooo! it works! this is a standard xajax response containing \n<pre>formvalues:\n".print_r($aFormValues,true)."</pre>" );
$objResponse->call("test");
return $objResponse;
}
?>
<!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" lang="en" xml:lang="en">
<head>
<title>XAJAX UploadProgress Plugin</title>
<?php $xajax->printJavaScript();?>
<link rel="stylesheet" type="text/css" href="demo.css" />
<script>
function tR(obj){
alert(obj.innerHTML);
}
function test() {
var div = document.getElementById("docs");
currentHref = document.createElement("a");
currentHref.innerHTML = "click Me";
currentHref.onclick = function(){ tR(currentHref) };
div.appendChild(currentHref);
}
</script>
</head>
<body onload=" ">
<h1>XAJAX ProgressUpload Plugin</h1>
<div id="docs">
</div>
<div id="example">
<h2>demo</h2>
<form enctype="multipart/form-data" id="upload_form" action="upload.php" onsubmit="return false;" method="post" >
<div class="formLabel">test field:</div>
<div class="formField"><input type="text" id="foo" name="foo" value="bar" /></div>
<br style="clear:both;" />
<div class="formLabel">Normal field 1:</div>
<div class="formField">
<select name="select1">
<option value="one">one</option>
<option selected="selected" value="two">two</option>
<option selected="selected" value="three">three</option>
</select>
</div>
<br style="clear:both;" />
<div class="formLabel">multiselect:</div>
<div class="formField">
<select name="multiselect[]" multiple="multiple">
<option value="one">one1</option>
<option selected="selected" value="two">two 2</option>
<option selected="selected" value="three">three 3</option>
</select>
</div>
<br style="clear:both;" />
<div class="formLabel"> </div>
<div class="formField"><input type="submit" value="test" onclick="xajax_test(xajax.getFormValues('upload_form'));" /></div>
<br style="clear:both;" />
</form>
</div>
<br style="clear:both;" />
<div id="response">
<h2>response</h2>
<div id="results">
</div>
</div>
<div id="copyright">
Copyright (c) 2007 by Steffen Konerow <br />
</div>
</body>
</html>