Link to home
Start Free TrialLog in
Avatar of PachecoPrimo
PachecoPrimo

asked on

Input box Filmaker Pro 11

I have a database (see attached) it hase a one table and a main layout. The layout out has a button that lets the user enter any number. The inputted number populates the field 'Enter_Number' which is set to receive only numeric data. Is there a way that when the users inputs their answers, the script can check to see that the value entered is indeed only numbers.
InputBox.fp7
Avatar of North2Alaska
North2Alaska
Flag of United States of America image

I use a custom function, IsNumeric( value, separator ) that returns true or false.  I don't recall where I found it and I don't claim to have written it.  I just use it...


Let
(
   [
   decSep = If (separator = ""; "."; separator);

   trimmedValue = Trim (value);
   filteredValue = Filter ( trimmedValue ; "0123456789-" & decSep );
   lengthOk =    If (Length (trimmedValue) = Length (filteredValue);  True;  False);

   dotOccurence = PatternCount (filteredValue; decSep);
   dotOk = If (dotOccurence = 0 or dotOccurence = 1; True; False);

   minusIndex = Position (filteredValue; "-"; 1; 1);
   minusOk = If (minusIndex = 0 or minusIndex = 1; True; False)
   ];
   If (lengthOk and dotOk and minusOk;
      True;
   /*else*/
      False
   )
)

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of soholm
soholm
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial