Page 1 of 1

How to exicute php form using javascript?

Posted: Sat Aug 08, 2009 1:07 am
by manudubey
HI Guys,

CMS made simple is the best cms. I got little problem with my contact form, i built it with php and j query. Form validation and every thing is working but when it comes to submitting the form i think java script is not able to trigger the php script.

//start the ajax
$.ajax({
//this is the php file that processes the data and send mail
url: "upload/process.php",

//GET method is used
type: "GET",

//pass the data
data: data,

//Do not cache the page
cache: false,

//success
success: function (html) {
//if process.php returned 1/true (send mail success)
if (html==1) {
//hide the form
$('.loading').fadeOut('slow');

//show the success message
$('.done').fadeIn(2000).fadeOut(5000);

//if process.php returned 0/false (send mail failed)
} else alert('Sorry, unexpected error. Please try again later.');
}
});

//cancel the submit button default behaviours
return false;
});
})


my php script is inside the upload folder. i don't know how to execute that php script. I know the form builder is cool to build the forms, but my form is bit fancy and i wanna use it.Can anyone help me please.

Thanks

Regards,
Dubey

Re: How to exicute php form using javascript?

Posted: Sat Aug 08, 2009 10:06 pm
by Dr.CSS
Fancy in what way, do you think you can't do the same thing in formbuilder?...