I found this script:
<label>password :
<input name="password" id="password" type="text" />
</label>
<br>
<label>confirm password:
<input type="text" name="confirm_password" id="confirm_password" /> <span id='message'></span>
http://jsfiddle.net/sprme2gq/2/
$('#confirm_password').on('keyup', function () {
if ($(this).val() == $('#password').val()) {
$('#message').html('matching').css('color', 'green');
} else $('#message').html('not matching').css('color', 'red');
});
but I'd like to compare the first input with the second, but instead compare the exact value, i'd like to compare if it is on its way.
For example,
the first input is: "1234"
and in the second is being typed: "12"
in this moment i'd like to show it's still right, or at least, that it's almost there, not as wrong and only when the input are exactly the same say it's right.
Could someone help me with this?