How to exicute php form using javascript?

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
manudubey
New Member
New Member
Posts: 2
Joined: Mon Aug 03, 2009 2:18 am

How to exicute php form using javascript?

Post 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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: How to exicute php form using javascript?

Post by Dr.CSS »

Fancy in what way, do you think you can't do the same thing in formbuilder?...
Post Reply

Return to “The Lounge”