Check if a user exists using an email input before showing a form (or any content, really) | erentzen.com

Put this in your functions.php or a plugin:

add_action('wp_ajax_nopriv_bsn_search_users','bsn_search_users');
function  bsn_search_users() {
	$user = get_user_by( 'email', $_REQUEST['user_email'] );
	if(false === $user) { // user doesn't exist
		// do something like:
		echo 'email not found'; // replace 'yourstatusmessageclass' with some class you define to hold the message
		exit();
	} else {
		// show the form
		echo ""; // replace 'form_wrapper_div' with the id of a div you place the form in
		exit();
	} 
}

Then in your page, go: