Re: validation not working (132 Views)
Reply
Advisor
SESHAC
Posts: 26
Registered: ‎12-06-2013
Message 1 of 4 (163 Views)
Accepted Solution

validation not working

Hi ,

 

I am doing the below validation in FC , here when i enter 6,7,8,9 number in field i am getting the validation, But it should not happen, This error is coming when i enter 6 or 7 or 8 individual number

 

Validation : $min>=0 and $min<=59

Message : Please enter "mins" value 0 to 60

Update: not null($min)

Set FOcus To : $min

 

Please help me

Please use plain text.
Honored Contributor
Audrey H.
Posts: 1,238
Registered: ‎07-27-2006
Message 2 of 4 (132 Views)

Re: validation not working

Hi,

 

Maybe it is not recognizing your $min as a number and is instead treating it as a string.  To test this, try changing your validation to:

 

Validation : val($min, 1)>=0 and val($min, 1)<=59

 

The val() function converts data types and the 1 tells it to convert it to a number.

 

Audrey

Please use plain text.
Advisor
SESHAC
Posts: 26
Registered: ‎12-06-2013
Message 3 of 4 (104 Views)

Re: validation not working

Hi Audrey,

Thank you very much for the solution. it was working perfectly
Please use plain text.
Honored Contributor
Audrey H.
Posts: 1,238
Registered: ‎07-27-2006
Message 4 of 4 (86 Views)

Re: validation not working

Hi,

 

This was really just a test to see if that was the reason your validation was triggering unexpectedly.  Do you care that your variable is sometimes being recognized as a string and not a number?  Are you doing something with the number in the variable?  If you don't care, then this would work as a "solution", but if you really want your variable to contain a number then you should do the conversion to the actual variable on the save event and then you could leave your validation as it was.

 

Audrey

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation