[Solved] Isgreaterorlessthan not working on dropdown lists

aijosh

Member
Hello,

I am having issues with the Isgreaterorlessthan validation.

I have two dropdowns populated using:

$year = (int)date("Y");
for ($x = 0; $x < 100; $x++) {
$options[] = JHTML::_('select.option', $year, $year);
$year = $year - 1;
}
return $options;

I have validation on one of the dropdowns(From Year) to check if the value is greater than that of the other dropdown(To Year).

The validation always fails whether the value is greater than, equal to, or less than.

What am I doing wrong
 
Looks like that was a bug. Certain element types (dropdowns, radios, etc) return their values as arrays, rather than single values. We weren't handling that correctly.

https://github.com/Fabrik/fabrik/commit/b50cfc683f5abc7b69203ca07f14e00aa3552af1

If you've installed / updated Fabrik recently, you can just extract and upload that one file from the tarball:

https://github.com/Fabrik/fabrik/archive/master.zip

If you haven't updated recently, I'd suggest doing a full github update (see wiki).

-- hugh
 
Great. :)Kinda works now.

Did you test the "Greater than or less than?" option. They dont seem to act as labelled (except I dont yet understand how the labelling works). Using "greater than" currently seems to work as "less than or equal to".
I just tested all and picked the one that did what I wanted
 
They seem to work as I'd expect. So if "less than" is selected, then the validation tests that the element's value (the one with the validation on it) is less than that of the "other element" (or static value), and passes validation if it is.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top