Field Value validation

Field Value validation

Hi,

I have a form where users enter in a unique coupon code to enter a competition.

At the moment the only validation is that the length matches, so a user can enter any X digit number and it will work.

I need to be able to compare the entered field value with the unique coupon codes and if there is no match the form doesn't submit..

Any pointers?
Thanks