Help use external javascript and php scripts

rading 11 Aug, 2009
Hey guys?

I have created a form that has some ajax code in it (within javascript tags). This I did with dreamweaver for debugging purposes. It goes something like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="javascript" type="text/javascript">
//Browser Support Code
function ajaxFunction(){
	var ajaxRequest;  // The variable that makes Ajax possible!
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
. more stuff goes here...
."GET", "ajax.php" + queryString, true);


<form name="payment">
    <label class="cf_label" style="width: 150px;">Student Id</label>
    <input class="cf_inputbox required validate-number" onblur="ajaxFunction()" maxlength="150" size="30" title="" id="stid" name="student_id" type="text" /> 
<br /><br />
. more form elements here
   <input value="Make Payment" name="pay" type="submit" />

I now want to use this on a similar chronoform that I have created with chronoforms. It also links to a database table.

Ok. As you can see, the file above calls a php file called ajax.php. How to I attach this file to the chronoform I have created?? The html part is ok and for the javascript part I copied it to the form code part called Form JavaScript but without the script tags and I think its also ok.

I have tried copying it (ajax.php) to the root of my joomla installation but submitting the form afterwards brings alot of errors such as below.
Parse error: parse error, expecting `','' or `';'' in C:\xampp\htdocs\Joomla\components\com_chronocontact\chronocontact.php(52) : eval()'d code on line 10

Fatal error: Call to a member function bind() on a non-object in C:\xampp\htdocs\Joomla\components\com_chronocontact\libraries\customcode.php(59) : eval()'d code on line 13

I dont understand how this has come about.

Any ideas??
nml375 11 Aug, 2009
Could you please verify that you have no dashes or spaces in your database table names?

This topic is locked and no more replies can be posted.