Solved

Field Input validation - phone formats

Posted on 2008-06-25
5
941 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

636 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