This is very easy:-
1. Write a JavaScript function.
2. Retrieve the value of your both textbox one by one
3. And then compare it.
4. After comparing if it returns false then display a alert message.
5. At last call this function on
onblur
event of your second textbox.
Following link might help you:
JavaScript String Compare[
^]
Now go ahead.
All the best.