methuselah
methuselah

Reputation: 13206

Setting responsetext on jquery form plugin

How do you set the responsetext on the jquery form plugin @ http://jquery.malsup.com/form/#ajaxForm

function showResponse(responseText, statusText, xhr, $form)  { 
    // for normal html responses, the first argument to the success callback 
    // is the XMLHttpRequest object's responseText property 

    // if the ajaxForm method was passed an Options Object with the dataType 
    // property set to 'xml' then the first argument to the success callback 
    // is the XMLHttpRequest object's responseXML property 

    // if the ajaxForm method was passed an Options Object with the dataType 
    // property set to 'json' then the first argument to the success callback 
    // is the json data object returned by the server 

    alert('status: ' + statusText + '\n\nresponseText: \n' + responseText + 
        '\n\nThe output div should have already been updated with the responseText.'); 
} 

Upvotes: 0

Views: 400

Answers (1)

Fabian
Fabian

Reputation: 3495

It comes from the file where you did the post request:

<form id="myForm1" action="dummy.php" method="post">
    <!-- your form -->
</form>

http://jquery.malsup.com/form/dummy.php

Upvotes: 1

Related Questions