using <validator> tags with regular expressions or mathematical expressions...
Hi all, I would like to use the validator tag to validate data using either regexes or math expressions. How can I do this? I tried using the "regex" type, but I'm not sure where to put the regex itself. I tried putting it in a file that was in the filename attribute, but that didn't seem to work. Essentially, I want to check if an integer input is even or not. - Nik. -- Nikhil Joshi Bioinformatics Programmer UC Davis Genome Center University of California, Davis Davis, CA http://bioinformatics.ucdavis.edu
So I figured it out... but for those who need to know: You can put the expression (e.g. value % 2 == 0) or the regex between the validator tags. I guess you have to use the keyword "value" for a mathematical expression or a regex to access the value of the field. So my validator for checking if the number was even looked like this: <validator type="expression" message="Window Size must be even">value % 2 == 0</validator> - Nik. On Tue, Aug 9, 2011 at 5:47 PM, Nikhil Joshi <nikhil.ashok.joshi@gmail.com>wrote:
Hi all,
I would like to use the validator tag to validate data using either regexes or math expressions. How can I do this? I tried using the "regex" type, but I'm not sure where to put the regex itself. I tried putting it in a file that was in the filename attribute, but that didn't seem to work. Essentially, I want to check if an integer input is even or not.
- Nik.
-- Nikhil Joshi Bioinformatics Programmer UC Davis Genome Center University of California, Davis Davis, CA http://bioinformatics.ucdavis.edu
-- Nikhil Joshi Bioinformatics Programmer UC Davis Genome Center University of California, Davis Davis, CA http://bioinformatics.ucdavis.edu
participants (1)
-
Nikhil Joshi