My form has 40 fields...
pos1 to 10
recommend1 to 10
desc1 to 10
image1 to 10
I need to check that all recommend fields are completed but less than 65 characters. Then I need to check that all desc fields are completed but less than 100 characters. Both feilds are textarea.
I know I can do
if ( strlen ( $recommend1 < 1 ) || strlen ( $recommed1 > 65 ) )
etc etc... but I don't want to do this for all 20 fields individually.
How can I do it using just a few lines of code rather than lots of coding for such a simple query? I also need to know which position the fields are at if they are incorrect. this can be determined by the pos1 to 10 fields if necessary. for example, if the field desc7 has more than 65 characters I need to know how to specify that it is desc7 that is incorrect.
Thanks