Hello all,
I am using XAMPP + WINDOWS to develop my prototype.
I have designed a form that uses jQuery Form Plugin to do the form submission.
When the form doesn't include FILE field, the return value looks like:
{"success":false,"msg":"incorrect-captcha-sol"} which is jason string.
However, after I add a FILE into the form, I always get sth like
<head></head><body>{"filesize":181,"success":false,"msg":"incorrect-captcha-sol"}<div firebugversion="1.5.4" style="display: none;" id="_firebugConsole"></div></body>
I need to get the filesize information from the server so that I can apply validation rule on the uploaded file. Now the return results look mess and is there way that I can get the json string instead?
Thank you
var options = { << client script
target: '#output', // target element(s) to be updated with server response
beforeSubmit: showRequest, // pre-submit callback
success: showResponse, // post-submit callback
url: 'recaptcha.php' // override for form's 'action' attribute
};
$('#myform').submit(function() {
$(this).ajaxSubmit(options);
return false;
});
$results['success'] = true; << server script snippet
$results['msg'] = 'Success, you may proceed!';
echo json_encode($results);