Link to home
Start Free TrialLog in
Avatar of error77

asked on

Submit a form using JQuery Ajax

Hi all,

I have a form and I'm submitting it the traditional way.

I need to do this without the page going away or refreshed. Ajax.

Can anyone give me simple instructions on how to do this please?

I prefer the JQuery way if possible.


Avatar of Deja Anbu
Deja Anbu
Flag of Oman image

here is a simple one

but what is the server side language u use?
Avatar of error77


I use PHP.

I've seen that tutorial before but I asked here because I wanted it broken down to the bones.

Avatar of OmniUnlimited
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Actually, your response could contain anything that you want:

$response = json_encode( array(
     'success' => true,
    'status' => "Let's party"
And then access them through the success function:

            cache: false,
            url: '',
            type: "POST",
            data: ({
                                            // List your post variables and their values
                                             fullname : fullname,
                email : email  // etc.
            dataType: "json",
            success: function(data){
                     alert(data.status); // Displays "Let's Party"
                                              // what you want done after successful transmission