newhck / php-form-builder-class

Automatically exported from code.google.com/p/php-form-builder-class
GNU General Public License v3.0
0 stars 0 forks source link

Defining Ajax-Handler #75

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This ist my form:
$news_form->setAttributes(array("method"=>"post", "action"=>"ajax.php", 
"height"=>"350", "width"=>"300", "ajax"=>"1", "ajaxCallback" => "cbf"));

My ajax.php now looks like this:
<?
switch($_REQUEST["xdo"]):
case "news_add":
echo "<?xml version='1.0' 
encoding='ISO-8859-1'?><response><status>good</status><message>Die News sind 
drin yeaah..".$_POST['f_title']."</message></response>";
break;
endswitch;
?>

My ajaxCallbackFunction in Javascript "cbf":
<script>
function cbf(bla){
alert(bla.responseXML.getElementsByTagName('response')[0].firstChild.nodeValue);
}
</script>

Firebug says: bla.responseXML is undefined

Now I think, that this "action"=>"ajax.php" and "ajax"=>"1" seems to be the 
wrong combination? If I am right, where can I define where the Request shell go 
to or which file is the ajax-handler (in my case ajax.php) ?

kind regards

Original issue reported on code.google.com by allaoui....@gmail.com on 2 Oct 2010 at 7:32

GoogleCodeExporter commented 8 years ago
Sorry guys, this should be at the user group.. delete pls..

Original comment by allaoui....@gmail.com on 2 Oct 2010 at 7:34

GoogleCodeExporter commented 8 years ago
This has been handled through the project's google group - 
http://groups.google.com/group/php-form-builder-class/browse_thread/thread/1e646
141a1337324

Original comment by ajporterfield@gmail.com on 3 Oct 2010 at 2:27