As far as I can tell, the FAPI range rule is not supported by clientside validation. Is that correct?

It works for me as FAPI validation, but a clientside rule is not generated, even though other FAPI rules are applied just fine.

Adding this to clientside_validation_fapi.module works for me (based on webform implementation):

case 'fapi_validation_rule_range':
		
			$range = array('min' => NULL, 'max' => NULL);

			$min = isset($params[0]) ? $params[0] : '';
			$max = isset($params[1]) ? $params[1] : '';
			
			if ($min != '' && is_numeric($min)) {
				$range['min'] = (int) $min;
			}
			if ($max != '' && is_numeric($max)) {
				$range['max'] = (int) $max;
			}
			
			_clientside_validation_set_minmax($name, $title, $range['min'], $range['max'], $js_rules);
			
			break;
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

amberau79’s picture

Issue summary: View changes
attiks’s picture

Can you provide a patch, instructions can be found at https://drupal.org/node/707484

bgilhome’s picture

Here's a patch against current 7.x-1.x branch.

bgilhome’s picture

Status: Active » Needs review
sdrycroft’s picture

The previous patch did not allow the use of a custom message. The attached patch (which is a very very minor tweak) does.