I have the form which is created through Webform module and now I need to add one more text field but its value has to be unique and can be only the value from some predefined list of allowed values.
It's not the problem that value of the field be unique (I can enable it in text field settings) but I don't have idea how to limit the value of the field on one from predefined list of values.
Those strings are voucher codes that are sent to the clients by email, also there are a 1500 different codes.
If the user enters the code that was already used or enters the code that doesn't exist in the list he should get the notification that the code is not valid right away (Ajax) or on the form submit.
Can anyone can help me with this or direct me? I'll appreciate any suggestion...