Solved

Field Input validation - phone formats

Posted on 2008-06-25
5
932 Views
Last Modified: 2013-12-18
Need help with field input validation for a Phone field that the user wants to be either US or International.
For example if a choice of Domestic is made then the format must validate to 199.999.9999 or if International then no validation is necessary.

How can I input validate the field conditionally?
0
Comment
Question by:Jimphot0
  • 3
  • 2
5 Comments
 
LVL 19

Expert Comment

by:madheeswar
ID: 21872170
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 21872171
0
 

Author Comment

by:Jimphot0
ID: 21873823
I am trying to check that the user formatted properly and if not, return a prompt telling them what format it should be and not save anything until correct. I can do that with our Javascript but I need it to be conditional to the US or Int'l drop-down choice they make.  For example, if dropdown choice is US then YES validate the format to be 199.999.9999 or if ddropdown choice is Int'l then no validation necessary (accept anything).
thanks
0
 
LVL 19

Accepted Solution

by:
madheeswar earned 500 total points
ID: 21874077
I assume it is for Notes client side and not for web.
In the InputTRansalation of the Phone field:
@If(ChoiceField<>"US";@Return(@Success);"");
@If(@Trim(@Length(FieldName))<>10 or (@Trim(@Length(FieldName))<>12;@Return(@Failure("Please enter a vaild phone number");@Success);
phone := @Trim(Field Name);
phonestripped :=@Trim(@Implode(@Explode(@LowerCase(phone); "."); ""));
@If(@Length(phonestripped) = 10; "(" + @Left(phonestripped; 3) + ") " +
@Right(@Left(phonestripped; 6); 3) + "." + @Right(phonestripped; 4); phone)
the above code does auto splits and appends "."

Play with the above code, you can achieve the result.

0
 

Author Closing Comment

by:Jimphot0
ID: 31470630
Thanks for the help -  with  this and some more searching I got there.
 
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question