Solved

Field Input validation - phone formats

Posted on 2008-06-25
5
927 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
Comment Utility
0
 
LVL 19

Expert Comment

by:madheeswar
Comment Utility
0
 

Author Comment

by:Jimphot0
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks for the help -  with  this and some more searching I got there.
 
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
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…
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

744 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now