Location: PHPKode > projects > PRAjax - PHP Reflected Ajax > examples/example_component_updatepanel.php.txt
<?php
// Set the header
header("Content-Type: text/html; charset=utf-8");

// Use bin or src?
$strSources = '../bin';

// Import PRAjax
require_once($strSources . '/PRAjax.php');

// Instantiate PRAjax
$objPRAjax = new PRAjax($strSources . '/');

// Handle PRAjax client request
$objPRAjax->HandleClientRequest();
?>
<html>
<head>
	<title>UpdatePanel</title>	
	<?php $objPRAjax->GetJavaScript(); ?>
	<script language="JavaScript" src="<?=$strSources?>/prajax_component_updatepanel.js"></script>
	
</head>
<body>
<div style="width: 100%; height: 65px; background-color: #EEEEEE; font-family: Arial, Helvetica, Sans-Serif; font-size: 9pt;">
This example shows a partial page refresh using the UpdatePanel component. Try filling in your name. When you submit the form, PRAjax hooks the submit event and submits the form in the background. The whole page is then fetched and updated on-the-fly.
<br>
<a href="example_component_updatepanel.php.txt" target="_blank">View code...</a>
</div>
<div id="divTest1" prajax_updatepanel="true">
	<form name="frmTest1" style="font-family: Arial, Helvetica, sans-serif; font-size: 11px;" prajax_updatepanelform="true">
	Your name: <input type="text" name="txtName" id="txtName" style="width: 150px;">
	<input type="submit" value="Submit">
	</form>
</div>

<div id="divTest2" prajax_updatepanel="true" style="font-family: Arial, Helvetica, sans-serif; font-size: 11px;">
<?=(isset($_POST['txtName']) ? 'You entered: ' . $_POST['txtName'] : 'The submitted name will appear here...')?>
</div>

<div id="divTest3" style="font-family: Arial, Helvetica, sans-serif; font-size: 11px;">
<?=(isset($_POST['txtName']) ? 'You entered: ' . $_POST['txtName'] : 'The submitted name will not appear here, because this is not an UpdatePanel...')?>
</div>

</body>
</html>
Return current item: PRAjax - PHP Reflected Ajax