I have Drupal 6.10 with CCK 6.x-2.2 and Validation_API 6.x-1.0.

I want to check two CCK text fields f1 and f2 with the regexp rule /^[0-9]{1,%arguments[0]}$/. They are on the same form. f1 must be 10 or less characters long and f2 – 20 characters or less. So I added validator to this two fields with different arguments.

I get validation for both fields 10 or less characters long.

After some research I found a bug (I think) in the code string
$validator->rule = str_replace('%arguments['. $delta .']', $argument, $validator->rule);.

All works fine after fix, but still, please review it. All the changes in the patch.

Comments

cardina1’s picture

Sorry, first patch don't allow several argiments in a regexp. Here is a new revision.