[eluser]iwillsoarlikeaneagle[/eluser]
Yes, you're right. After I submitted the form correctly it just displayed a white page that displayed '{ "message" : "Your data has been saved" }'.
Here's what I've got after applying json_encode() and changing the js:
1. If I submit the form with invalid values (empty text fields), it displays the alert box (which shouldn't be, right?).
2. The same happens when I submit the form correctly..it displays the alert box AND the page with just '{ "message" : "Your data has been saved" }' as the other output.