Entry
How can i compare the values of two text fields?
Feb 15th, 2001 20:00
Tom Kopke, Mark Neal,
You can use a function to compare two text fields of NAME values of
your choice.
function compare(form) {
name1 = form.name1.value;
name2 = form.name2.value;
if (name1 != name2) {
alert ("\nThe entries do not match. Please re-enter.")
return false;
}
else return true;
}
Execute the function with your favorite function call such as "onclick"
If the two fields don't match, a Javascript popup window appears with
the text shown above