Quantcast
Channel: Topic Tag: action | WordPress.org
Viewing all articles
Browse latest Browse all 889

cancel my form using function hook

$
0
0

i want to cancel my form using function hooks

add_action( 'forminator_custom_form_submit_before_set_fields', function( $entry, $form_id, $field_data_array ){		
  $phone = $_POST['phone-1'];
	
  global $wpdb;
  $results = $wpdb->get_results('select * from <code>wp_users</code> where user_login = "'.$phone.'"');
  if ( $results ) {
    var_dump("same number exits");
    return false; // cancel the form
  } else {
		var_dump('success!');
	}

},20 , 3 );

Viewing all articles
Browse latest Browse all 889

Trending Articles