TextField validation with duplicate entries

Hey guys,

Just wanted to know if anyone could help me with a problem I’m having with passing some validation in a form im creating.

For the sake of getting to the point, I have two Textfields in my form lets say **email_txt **and friendsEmail_txt. What I would like to do is validate the two fields to make sure the user does not put the same email address in both fields.

Im sure I need to do this via a function but I’m lost as to how to go about it. I googled for about an hour and perhaps im not qeurying it properly as I could not find any answers - Im sure there is one.

Any help anyone could provide would be great!