-1

I'm using Respect validation for my PHP form. It works fine for all elements but not sure which validation rule to use for the country select element. The default value (when the select box displays 'Please select one') is -1. In all other cases, the value is a string. So I want to check if the value of country is different from -1. Obviously v::notEmpty() does not work. Is there a validation rule in Respect for something like this? or should I write my own rule? Thanks.

cesarcarlos
  • 1,271
  • 1
  • 13
  • 33

1 Answers1

0

v::stringType()->notEmpty()->validate($country); should work....

see documentation: StringType, NotEmpty

Averias
  • 931
  • 1
  • 11
  • 20