How to return a value inside a function to parent function in javascript?
I'm trying to return true or false to a function depending on the response of an AJAX function inside of it but I'm not sure how should I do it, I made a fiddle to illustrate this better:

http://jsfiddle.net/vengiss/3W5qe/

I'm using jQuery and the Malsup's Ajax Form plugin but I believe this behavior is independent of the plugin, I just need to `return false` to the `beforeSubmit` function depending on the `POST` request so the form doesn't get submitted every time. Could anyone point me in the right direction?

Thanks in advance!
How to return a value inside a function to parent function in javascript?
===

I'm trying to return true or false to a function depending on the response of an AJAX function inside of it but I'm not sure how should I do it, I made a fiddle to illustrate this better:

http://jsfiddle.net/vengiss/3W5qe/

I'm using jQuery and the Malsup's Ajax Form plugin but I believe this behavior is independent of the plugin, I just need to `return false` to the `beforeSubmit` function depending on the `POST` request so the form doesn't get submitted every time. Could anyone point me in the right direction?

Thanks in advance!