how to compare the value

Cr4zZyMaN

New Member
This my codeI am getting email address from database through ajax and mysql it is giving me value in . so in below FUNCTION comparing() i am retriving data from span to compare with the textfield data. but it is not comparing properly.Please help me out \[code\]function validate(pageForm) { /************Getting error values in return values***********************/ var returncomparing = ""; /*********************************/ //FIELD WHICH YOU HAVE TO VALDATE returncomparing += comparing(pageForm.email); /********************************************/ if (returncomparing != "") { document.getElementById('error').innerHTML = returnIndustry; } return false; }\[/code\]After giving correct EMAIL still it is giving Error ... (Please Provide Login User ID)\[code\]function comparing(pageForm){ var error = ""; // var fetchedEmail=document.forms["pageForm"]["email_fetch"].value; var em=document.forms["pageForm"]["email"].value; //var emai = document.getElementById('emlTst').value; var email = document.getElementById('txtHint').innerHTML; //document.getElementById('emlTst').value = http://stackoverflow.com/questions/14414747/email; if(em != email){ document.getElementById('error_email2').innerHTML="Please Provide Login User ID"; pageForm.style.borderColor = 'red'; error='5'; } else if(em == email){ document.getElementById('error_email2').innerHTML=""; error = ""; } else { document.getElementById('error_email2').innerHTML=""; pageForm.style.borderColor = '#c7c7c7'; } return error;}/*************************************************************/\[/code\]
 
Back
Top