• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ajax Form (plus image upload)

#1
Lightbulb 
Hello all !

I'm making a form , With 3 fields: first name, last name, ID
Plus: profile picture

For now all good, searching on the net I learned how to upload an image with ajax

the problem is when i put in When I put these values in my JS code ( for upload image )


PHP Code:
contentTypefalse, 
processData
false

this part broken , I mean the msg returns blank

PHP Code:
$data['state'] = 'error';
$data['msg'] = validation_errors();
header('Content-type: application/json');
echo 
json_encode($data); 

in mi console whit console.log :

Object {state: "error", msg: ""}


Some way to get the message back correctly? I guess the problem is contentType.
I do not know what to do really, help

thanks for reading
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.