Hello, I'm new in javascript and jquery, and i need little help.
function checkUsername(name) { function checkUsername(name) { $.post(prefix+'/registration/checkUsername', {username:name.val()},function(data){if (data == 'yes'){name.addClass ('ui-state-error'); updateTips('Username taken'); return false} else {return true} }); } How can I set checkUsername to "true" or "false" from function(data) which is communicating with my php code. Thanks.