HI,
I have to validate my email id and confirm email id when i am entering the character-wise it should validate and show the result.
HI,
I have to validate my email id and confirm email id when i am entering the character-wise it should validate and show the result.
You can achieve this by using simple jquery and javascript
Html Code
[html]
<input type="text" id="txtEmail" />
<input type="text" id="txtEmail2" />
<span id="confirmMessage" class="confirmMessage"></span>
[/html]
And jquery/javascript code
<script>
$(function () {
$("#txtEmail2").keyup(function () {
var email = $("#txtEmail").val();
var confirmEmail = $("#txtEmail2").val();
var altMessage = document.getElementById('confirmMessage');
if (email != confirmEmail) {
$(this).css('background-color', '#CD5C5C');
altMessage.style.color = "#CD5C5C";
altMessage.innerHTML = "Email Do Not Match!"
return false;
} else {
$(this).css('background-color', '#009900');
altMessage.style.color = "#009900";
altMessage.innerHTML = "Email Match!"
}
return true;
});
});
</script>