PClib demo site

<?elements
class form name "personform" route "ajaxform"
select ADEMO lb "Choose AJAX action:" ajaxget "NAME,SEX,SURNAME,COUNTRY,INTERESTS,COMMENT"
input NAME lb "Name:"
input SURNAME lb "Surname:"
radio SEX lb "Sex:" list "M,Male,F,Female"
select COUNTRY lb "Country:" list "1,Czech,2,Poland,3,Germany,4,USA"
check INTERESTS lb "Interests:" list "1,pclib,2,Sport,3,Books,4,Movies" columns "2"
text COMMENT lb "Comment:" size "50x4"
button insert lb "Submit"
button cancel lb "Back" onclick "history.back()"
?>

<style>
.radio-group div {float:left}
</style>
<h2>AJAXform demo</h2>

<p class="blue">
<b>How it works?</b><br>
To enable ajax add atribute "ajaxget" for any field in template.<br>
Now you can implement action 'ajax' in your php. Create form object and make your changes.
Calling $form->ajaxsync(); will synchronize the form with onscreen form. Look at the source!
</p>

<table>
<tr><td>{ADEMO.lb}</td><td>{ADEMO}</td></tr>
<tr><td>{NAME.lb}</td><td width="400">{NAME}</td></tr>
<tr><td>{SURNAME.lb}</td><td>{SURNAME}</td></tr>
<tr><td>{SEX.lb}</td><td>{SEX}</td></tr>
<tr><td>{COUNTRY.lb}</td><td>{COUNTRY}</td></tr>
<tr><td colspan="2">
{BLOCK b_down}
{INTERESTS.lb}<br>
{INTERESTS}<br><br>
{COMMENT.lb}<br>
{COMMENT}<br><br>
{/BLOCK}
</td></tr>
</table>

{insert} {cancel}
<script language="javascript">
/* function ajaxcomplete(id) { alert('Hi! '+id)}
pclib.ajaxcomplete = ajaxcomplete;
*/
</script>

Elapsed time: 12.81 ms