Getting multiple variables back from PHP file after ajaxSubmit or $.post method
NickName:David Ask DateTime:2011-09-17T22:49:47

Getting multiple variables back from PHP file after ajaxSubmit or $.post method

Up to this moment I was using this types of methods to send some variables via Ajax to server side php file and bring back some answer.

$('#some_form').ajaxSubmit({
    success: function(result)
    {
        some code....
    }
});


$.post('serverside_script.php', { variable: 'value' },
    function(result) 
    {
        some code...
    });

Answer was always in 1 variable and it was ok till now. But now I need several variables to come back from PHP side. How can I modify my scripts to get several variables back ?

Copyright Notice:Content Author:「David」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/7455597/getting-multiple-variables-back-from-php-file-after-ajaxsubmit-or-post-method

More about “Getting multiple variables back from PHP file after ajaxSubmit or $.post method” related questions

Getting multiple variables back from PHP file after ajaxSubmit or $.post method

Up to this moment I was using this types of methods to send some variables via Ajax to server side php file and bring back some answer. $('#some_form').ajaxSubmit({ success: function(result) ...

Show Detail

Getting multiple variables from post to php

I am getting data from my database without reloading the page by posting to a php page. function getdata() { $.post( "somepath/getdata.php", function(o) { var texts = o.split('&;'); ...

Show Detail

AJAX troubles, getting reply back from PHP

Trying to create a Mail Chimp signup form using Mail Chimp API 3.0. So far, I have a form that validates with the jQuery Validation plugin and posts to a PHP script using jQuery Form plugin. The PHP

Show Detail

How to pass variables back using jquery .post from a php file?

All I want is that in php script 1 that has the .post javascript jquery lib code. I want php script 1 to send a form submission to php script 2 that would take those values and update the database....

Show Detail

returning variables from AJAX / php file

I am using AJAX and trying to return variables that I got after querying the database in the modcomp.php file, I am then trying to input those values back into my main site to put into input boxes.

Show Detail

How to handle after ajaxSubmit()

Previously, my code in the following was working fine and the ajaxSubmit request was done successfully. $(document).ready(function() { $('#restaurant_photo_upload').submit(function() {...

Show Detail

Passing Back multiple PHP variables after a ajax Form Call

I am passing a file to a php file via ajax and i am returning only 1 $ variable using die($var) in the php file after a sucsessfull run... the problem i am now facing is passing more than 1 variable

Show Detail

Replace form with Results after ajaxSubmit

I am trying to dynamically replace a form with the results from the POST response. For this example, I am closing an announcement and would like the "Close Announcement" submit button / form to be

Show Detail

is it posible to pass pre-fetched data through ajaxSubmit() or ajaxForm() method in jquery

I am trying to implement a form submission through ajax using ajaxSubmit(). I fetched values from the form and stored in a 'data' variable and trying to pass with the ajaxSubmit() function, is it

Show Detail

send data from two forms with one button to one php receiver with ajaxSubmit() function

I have two forms in html: <form id="form1" action="update.php" method="post"> <input type="text" name="username1"> </form> <form i

Show Detail