When adding new Numeric Webform Validation and not specifying a numeric range, I get the following error:
Notice: Undefined variable: range in clientside_validation_webform_add_webform_validation() (line 104 of \sites\all\modules\clientside_validation\clientside_validation_webform\clientside_validation_webform.module).
Looking at the code there it appears that the $range variable is not initialized outside of the if (strpos($data, '|') !== FALSE) statement. So if you do not define a range it attemps to use the non-existent $range variable in the clientside_validation_set_minmax() function call.
A similar error occurs when you only define only a min or a max (and not both) since one of the array keys is undefined in those cases.
Even with that warning aside, there does not appear to be any validation function in the clientside validation module to just check if the field is numeric.
Let me know if this makes sense. I will be happy to help troubleshoot and correct these issues.
I am using the following versions of the modules:
Clientside Validation module version 7.x-1.x-dev (build date of 9/22/2011).
Webform Validation module version 7.x-1.0
Webform module version 7.x-3.11
Comments
Comment #1
hooface CreditAttribution: hooface commentedsubscribe
Comment #2
attiks CreditAttribution: attiks commentedLatest dev version contains the following, was fixed by this commit
Comment #3
attiks CreditAttribution: attiks commentedif not, re-open
Comment #4
beefheartfan CreditAttribution: beefheartfan commentedAttiks, thanks for the quick update.
However, your newly committed code still misses one test case. In Webform Validator, if you want to set a numeric minimum and not a maximum you only need to type a number into the Range field. Thus, fields that only have a minimum value do not contain the '|' and are missed by the validation.
Code such as this I believe will fix the issue:
Comment #5
attiks CreditAttribution: attiks commented@beefheartfan: I knew already, but didn't have time to add it, we'll add your code somewhere tomorrow, your fix looks good.
Comment #6
Jelle_SFixed in latest dev version