Thank you superfly. It is really helpful.
Lewis
----------------------------------------------------------------------
Message: 1
Date: Wed, 16 Jan 2008 06:58:46 -0800 (PST)
From: superfly
Subject: Re: [HTML_AJAX-devel] Best way to do AJAX
To: html_ajax-devel at lists.bluga.net
Message-ID: <14881479.post at talk.nabble.com>
Content-Type: text/plain; charset=us-ascii
hey lewis!
first see the examples how to setup the PEAR_AJAX server.php and to start
the class. when you got this, you should end up with a class you start via
the server.php. in this class you can put functions to interact with your
form. i show you an example how i made this for a project from myself...
in this func a user uses a radiobutton so re-sort the search results
class ajaxclass {
function ajaxclass(){
}
function updateorder($order, $pageID){
if(!empty($_SESSION['query'])){
require_once 'HTML/AJAX/Action.php';
$objAction =& new HTML_AJAX_Action();
if($order=='zuname'){
$_SESSION['query']['order'] = 'zuname';
}
if($order=='company'){
$_SESSION['query']['order'] = 'company';
}
if($order=='lastEdit'){
$_SESSION['query']['order'] = 'lastEdit';
}
if($_SESSION['query']['output']=='adressen'){
$output = utf8_encode(queryOutputAdresses($_SESSION['query'],$pageID));
}else{
$output = utf8_encode(queryOutputMarketing($_SESSION['query'],$pageID));
}
$objAction->assignAttr('result', 'innerHTML', $output); // 'result' is
the ID of an html element
return $objAction;
}
}
on the HTML side i call this func with:
onclick="ajaxclass.updateorder('company','$pageID');"
and the ajax output goes to
src="server.php?client=all&stub=ajaxclass">
var remote = new ajaxclass({});
sorry my english is not the best and this example might not be perfect
either, but maybe you get a glimpse how to use PEAR_AJAX
have fun,
superfly
standerby wrote:
>
> Hi,
>
> I am working on a web page, which has check box, radio button, slider,
> etc. What I want to accomplish is to display some data retrieved from
> database using the criteria enforced by those controls. I am using MDB2
> for database accessing and it works great. My question is what method I
> should use for HTML_AJAX to interactive with customer. For instance if a
> customer check a checkbox it will make a query to database and update the
> content div.
>
> Thanks,
> Lewis
>
>
> ---------------------------------
> Never miss a thing. Make Yahoo your homepage.
> _______________________________________________
> Html_ajax-devel mailing list
> Html_ajax-devel at lists.bluga.net
> http://lists.bluga.net/mailman/listinfo/html_ajax-devel
>
>
--
View this message in context: http://www.nabble.com/Best-way-to-do-AJAX-tp14744756p14881479.html
Sent from the HTML_AJAX Dev/Support mailing list archive at Nabble.com.
------------------------------
_______________________________________________
Html_ajax-devel mailing list
Html_ajax-devel at lists.bluga.net
http://lists.bluga.net/mailman/listinfo/html_ajax-devel
End of Html_ajax-devel Digest, Vol 29, Issue 2
**********************************************
---------------------------------
Never miss a thing. Make Yahoo your homepage.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bluga.net/pipermail/html_ajax-devel/attachments/20080116/44944a77/attachment.html