Skip to content

Instantly share code, notes, and snippets.

@madeinnordeste
Created April 4, 2015 12:40
Show Gist options
  • Save madeinnordeste/efca5df686f87dd16424 to your computer and use it in GitHub Desktop.
Save madeinnordeste/efca5df686f87dd16424 to your computer and use it in GitHub Desktop.
/*One: */
var data = $("#emailaddress:input").serialize();
//maybe is not necessary use serialize() method;
var data = $("#emailaddress").val();
/*Two:*/
//to submit for php script you can use:
var data = $("#emailaddress:input").serialize();
var params = {email: data}
$.post( "bryte-verify.php", params)
.done(function( data ) {
alert( "Data Loaded: " + data );
});
/*Three:*/
//After submit email address, is necessary handle te return to validate or not the email adress submited, ex:
var data = $("#emailaddress:input").serialize();
var params = {email: data}
$.post( "bryte-verify.php", params)
.done(function( data ) {
if( data.email.status == 'valid' ){
alert('valid email')
/* other actions */
}else{
alert('invalid email');
/*other actions*/
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment