Ajax frontend for my backoffice in jQuery and PHP

This is my way to organize php for a simple jQuery frontend ajax based:

1.in a administration page include the php that generate html for each box
2.for each box setup behavior in Javascript
3.let each php manage POST request (for change/update) and GET request for show content

So in admin.php we could have something like that

<img src=”button.png” id=”btn_change” />
<div id=”box-profilo”>
<?php include “box-profilo.php”>

For setup behavior in javascript I use jQuery and an utility function (in admin.php):

CheckForm = function(d,f,o){return f.valid();};
   function addModBehav(link,div,url,form,cancel) {
   var revert = function() {
       return false;

box-profilo.php contains something like

if(isset($_POST['save'])) {
// save code
if(isset($_GET['method'])) {
if(method =='modify') {
<form id=”form_profilo” action=”box-profilo.php” method=”post”>
<input type=”button” id=”cancel” />
} else {
// show data

Used plugins:
ajaxForm plugin for function ajaxForm()
Validation plugin for function valid() (in CheckForm)

Image icon Includeprofilo.png115.99 KB
Image icon profilo-view.png10.45 KB
Image icon profilo-modify.png10.08 KB