Telephone number text box

Hi All,
i have text box as an input parameter in which telephone number has to be entered.
i need to validate the input entered by the user that the number that they have entered is in the correct format or not.
the number should be in the below format
EG: XXX-XXX-XXXX
Can u guys help me out how to validate the text that has been entered.

Hi,
You can split the values and store them in an array.
Tel := Split ({field},'-');
Then you could check the array element length.
If (length(Tel[1]) = 3 and length(Tel[2]) = 3 and length (Tel[3]) = 4) then
"The telephone number is valid"
else
"The telephone number is not valid"
This way you could check the Telephone Number.
Hope this helps!
Edited by: ananth2009 on Dec 2, 2010 12:55 PM

Similar Messages

  • CVP Opsconsole: Patterns for RNA timeout on outbound SIP calls - Dialed Number (DN) text box does not take any input

    Hi there,
    I'm having problems modifying the 'Dialed Number (DN)' text box under 'Advanced Configuration->Patterns for RNA timeout on outbound SIP calls' of the SIP tab in the Cisco Unified Customer Voice Portal 8.5(1) opsconsole. In a nut shell, I need to change the RNA timeout but some reason when typing into the Dialed Number text box, the input is not taken. The reason I want to change this settings is because my ICM Rona is not working with CVP:
    https://supportforums.cisco.com/thread/2031366
    Thanks in advance for any help.
    Carlos A Trivino
    [email protected]

    Hello Dale,
    CVP doesn't allow you to exceed the RNA more than 60  Seconds. If you want to configure the timer for DN Patterns you should  do it via OPS console, It would update the sip.properties files in  correct way, the above way is incorrect.
    Regards,
    Senthil

  • Gray out or disable text box

    Hi,
         I have a drop down menu called CN_Entry_Initials that has options of a "C" or an "N". I also have a text box called Part_Number to enter a part number into. I want the Part Number text box to be grayed out or disabled until either a "C" or an "N" has been chosen out of the CN_Entry_Initials drop down menu. I have this working, except that I cannot get the Add button to do anything. I think it’s something to do with the way I have the If statement for this disabled text box, or do I have to change the button to a submit button. Does anyone know how to fix this? Below is the javascript and the drop down menu and text box code along with the Add or submit button. There is extra stuff in the Javascript that I have on the page, but I don't need to worry about those things since they are working correctly. I have the disabled text box code at the top of the javascript under the function verify() code. Thanks.
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Original:  Wayne Nolting ([email protected]) -->
    <!-- This script and many more are available free online at -->
    <!-- Begin
    function verify()
    if (document.getElementById('CN_Entry_Initials').value == "C"
    || document.getElementById('CN_Entry_Initials').value == "N")
        document.getElementById('Part_Number').disabled = false;
    else
        document.getElementById('Part_Number').disabled = true;
    var PartNum=document.AddECNumber.Part_Number.value;
    var regularExpression = new RegExp(/[cC][0-9]/); //regular expression to check for a letter C followed by a number
    if(regularExpression.test(PartNum)&& document.AddECNumber.CN_Entry_Initials.value == "N" && document.AddECNumber.Validation_Qty.value == "") { //this will return true if the input passes the regular expression
    alert("Enter a Validation Quantity for this new Custom");
    else if(document.AddECNumber.CN_Entry_Initials.value == "N" && document.AddECNumber.P_Drive_Docs_Initials.value == "i") { //this will return true if the input passes the regular expression
    alert("You cannot select 'i' for docs to be removed for a new part");
    else if(document.AddECNumber.CN_Entry_Initials.value == ""  && document.AddECNumber.SW_Model_Only.value == "0") { //this will return true if the input passes the regular expression
    alert("ECO type required - Select (N)ew or (C)hange for eco line item");
    else if(document.AddECNumber.PNR_BOM_Change_Only.value == "1" && document.AddECNumber.CN_Entry_Initials.value != "C" && (document.AddECNumber.Release_Status_Initials.value == "U"
    || document.AddECNumber.Release_Status_Initials.value == "N")) { //this will return true if the input passes the regular expression
    alert("ECO type required - Select (C)hange for eco line item and Select N for Release Status if PNR/BOM Change Only is yes");
    else if(document.AddECNumber.PNR_BOM_Change_Only.value == "1" && document.AddECNumber.CN_Entry_Initials.value == "C" && document.AddECNumber.Release_Status_Initials.value == "U") { //this will return true if the input passes the regular expression
    alert("ECO type required - Select (C)hange for eco line item and Select N for Release Status if PNR/BOM Change Only is yes");
    else if(document.AddECNumber.Doc_Changes_Only.value == "1" && document.AddECNumber.CN_Entry_Initials.value != "C") { //this will return true if the input passes the regular expression
    alert("ECO type required - Select (C)hange for eco line item since Doc Changes Only is yes");
    <!--- else if (document.AddECNumber.P_Drive_Docs_Initials.value == "i")
    // self.location='eco_search.cfm'; --->
    else
    document.AddECNumber.submit();
    //  End -->
    </script>
    <cfform name="AddECNumber" action="add_new_ec_number_action.cfm" method="post">
    <tr>
    <td class="edit" align="right">Change or new entry:</td>
    <td>
              <select name="CN_Entry_Initials" id="CN_Entry_Initials" onchange="verify();">
                <option value="">Select</option>
    <!--------- POPULATE SELECT BOX WITH P_Drive_Docs_Initials FIELDS --------->
                <CFOUTPUT QUERY="ShowCNEntryInitials">
                <option value="#CN_Entry_Initials#">#CN_Entry_Initials#
                </CFOUTPUT>
              </select>
    </td>
    </tr>
    <tr>
    <td class="edit" align="right" valign="middle">Part Number:<br><h6>(Limit to 25 characters)</h6></td>
    <td><input type="text" name="Part_Number" id="Part_Number" maxlength="25" size="27" disabled="disabled"></td>
    <td><textarea name="Description" cols="30" rows="3"></textarea></td>
    </tr>
    <input type="button" value="Add" onclick="verify();">
    </cfform>
    Thanks.
    Andy

    I don't understand about using the alert box to output the variables. I know that everything was working with alert boxes, etc. before I added the code for the disable text box code. The difference I see is on the disable text box code I use document.getElementById and on the other code I use document.AddECNumber. Could this cause the Add button to not work? If so, how do I change this code to make it work? I tried just changing it be like the document.AddECNumber code, but that didn't work.
    Andy

  • How to get the number from a xml file to flash as3 Text Box "Get_Days"?

    Hi,
    I have to daily update the number of days finished from the specified days. Say, One work to be finished in 30 days. And the start day is today. So, tomorrow it will be 29 days left. and so on....
    So, instead of reducing one number everyday from the last days number using flash, it will be easy changing in xml file.
    How can I do that?
    I have a simple text box "dynamic text box" and the instance name : "Days_Left". Since I am learner, I cannot make complex projects. I am learning small things with very few lines of code which can be modified using xml files.
    So, Whatever I type in a xml file, it should appear in a text box called "Days_Left".
    Thanks.

    then you can use:
    var currentDate:Date = new Date(); 
    // this is today's date
    var projectDueDate:Date = new Date(2010,11,29); 
    // use whatever date you want for the due date.
    // months are zero-based.  (ie, jan is month 0, dec is month 11.)
    var daysToCompleteProject:Number = (projectDueDate.getTime()-currentDate.getTime())/(1000*60*60*24);
    // this is number of days between currentDate and projectDueDate.  you probably want to round or use days:hours:minutes for your display

  • After upgrading to Firefox 8.0.1, now on at least one website I use, it limits the number of characters that I can type in a text box to 275, is there a way to fix this?

    After upgrading to Firefox 8.0.1, now on at least one website I use, it limits the number of characters that I can type in a text box to 275, is there a way to fix this?

    That may be part of the coding that the web page is using.
    *https://developer.mozilla.org/en/HTML/element/input

  • Coding - returning the number of characters in a text box.

    I am in the process of creating a cell phone simulation/animation in Edge Animate CC for use in a Captivate course. Basically, when a user clicks on number buttons on the virtual keypad, it displays the numbers in a text box , just like an actual cell phone would display the phone number on the screen as a caller is dialing. So, the user would click seven buttons and a seven-digit phone number appears on the virtual phone screen.  This part of my animation works great and all seven digits appear, but I would like to modify the code so that a hyphen appears after the third button clicked. This way, the output better resembles an actual phone number instead of just a string of seven digits.
    Here is an example of the code I currently have assigned to the #2 button on the virtual keypad:
    var text = sym.$("PhoneNum").html();
    text = text + 2;
    sym.$("PhoneNum").html(text);
    PhoneNum is the name of my text box on the stage where the digits appear as each keypad button is clicked.
    In order to incorporate the hyphen after the third button clicked, I need to somehow return the current number of characters in the PhoneNum text box, then create an if/else scenario that applies the hyphen after the third button clicked.
    Does anyone know how I can use either JavaScript or jQuery to return the number of characters currently in the PhoneNum text box?

    No problem!
    Basically the thing to remember is that unless you are needing to pass html to the object, you can use text() instead. text() also gives you the raw text without any html formatting (so you can assume what .html() would return)

  • How do i change the number of columns within a text box?  I need to go from three columns to one.

    How do I change the number of columns within a text box?  I need to go from 3 columns to 1.  The insert column is highlighted and column break does not work for this.

    Pages '09 does not seem to allow layout breaks in Textboxes.
    Pages 5.2 has the same limitation.
    Use multiple linked Textboxes in Pages '09 to get the layout you want or create your layout in a Word Processing template in the document layer.
    Peter

  • Varying number of columns within same text box

    I am reposting this here as suggested. This has been submitted to the feature request. If you are also interested in this feature, please also submit it there.
    here is original posting with replies:
    http://www.adobeforums.com/webx?224@@[email protected]
    One feature still missing (correct me if I am wrong) is to have number of columns applied to paragraphs not text boxes.
    This is a constant hassal having to interupt the text box with a new text box and then another one after that just because you want a paragraph to be in muliple columns to save space for instance, or using some other work around like inline text boxes.
    This is useful when trying to save space on a page, if you have short bullets, such as a list of items which if just left in a single column would leave a lot of white space to the right side of the column. Use this paragraph as an example. Pretend this is the lead in paragraph referring to the followng list. Include these items in your recycling:
    -plastic bottles
    -paper cups
    -styrofoam
    -tires
    -fruit
    -vegetables
    -glass jars
    -batteries
    -cans
    -drink boxes
    -bones
    -dairy products
    -pet hair
    -newspapers
    -magazines
    As you can see the list can get very long, and so breaking the list across a number of columns would really save space, as the bullets are just single words.
    I have this situation everyday in the work I do and it is a real pain to have to redraw a new text box for each instance, and then another one to follow it.
    And of course there is the whole headings that span multiple columns issue too.
    I could forsee a feature where you would simply select the number of paragraphs and then change the number of columns. If it went to another page, then the number of comumns would still be applied as it is applied now to a text box.

    Thanks for your suggestions, Eugene. That's what users helping users is all
    about!
    However, we build the document (a book with hundreds of pages)
    automatically, importing and autoflowing tagged text. Manual intervention
    doesn't meet the need.
    It's silly that a title or introduction should have to be in a different
    frame from the rest of the text, just because the title/intro is
    single-column and the text is multi-column. Ventura Publisher supported
    paragraphs spanning columns 20 years ago. Adobe, get with the times!
    Darrel Eppler
    Global Publishing Services
    SIL International
                                                                                    Eugene Tyson                                             
                 <[email protected]                                        
                 >                                                          To
                                           DARREL EPPLER                  
                 05/21/2009 03:18          <[email protected]>        
                 AM                                                         cc
                                                                                    Subject
                 Please respond to         varying
                 clearspace-118700         number of columns within same text
                 4112-1NVP-2-8iM2@         box                            
                 mail.forums.adobe                                        
                       .com                                                                               
    If you need to make it go from 1 column into multiple columns in a layout
    then it stands to reason that you also need the content to remain in the
    multiple columns.
    There are various ways to do this.
    1. Using Tables: You can have as many columns and rows as you like. The con
    about this is that tables cannot break over pages, so you have to manually
    split the cell so that the content fits.
    2. Use Tabs: This can be awkward if your text is already in a list format,
    it involves cut and paste and isn't "that" easy to implement. If the text
    is already in a layout format that suits then putting in tabs would work
    fine. The advantage is that this can break easily over pages/columns etc.
    It's flexible to adjust the spacing etc. But it can be awkward to setup,
    especially if there is a long list that needs to be in 2 or columns...
    so then you have this option:
    3. Use an anchored text frame: If you cut the content from your text frame
    and paste it into a new text frame: Then anchor the new text frame into the
    layout. You can specify the amount of columns in the anchored text frame.
    The frame will move with the text, but just like tables, they won't split
    over pages.
    I've used all 3 on many occasions depending on what scenario came up -
    different layouts need different workarounds.
    But they shouldn't be work arounds, it should be just select this text and
    put it into x amount of columns, and it should all flow without having to
    do much else.

  • Text flow into one or two column text boxes depending on the number of text lines

    Question InDesignCS3
    Is it possible to let text flow into one or two column textboxes depending on the number of text lines?
    Example 1)
    --Default text box--|
    | Text line 1 |
    | Text line 2 |
    | Text line 3 |
    | Text line 4 |
    ------------------- |
    If there are more than 4 text lines in the in the text box, this box has to become a two column box. like example 2
    example 2)
    |Text line 1 | Text line 4 |
    |Text line 2 | Text line 5 |
    |Text line 3 | Text line 6 |

    if (myTextFrame.lines > 4) {
    myTextFrame.textFramePreferences.textColumnCount = 2;
    } else {
    myTextFrame.textFramePreferences.textColumnCount = 1;

  • Count the number of carriage returns in a multiline text box

    Hello,
    I have a script to count the number of carriage returns at the end of each line of text in a multiline text box.
    After running the script in the console, the result keeps showing as 0.
    Can anyone please advise how the script can be revised to count the number of carriage returns?
    var count = 0;
    for (var i = 0;  i < this.getField; i++)
    var f = this.getField("ActionAgenda");
    if (f.value =="\u000d") count++
    console.println("There are a total of "+ count + " carriage returns.");
    Any assistance will be most appreciated.

    Try this:
    var count = 0;
    var s = getField("ActionAgenda").valueAsString;
    for (var i = 0; i < s.length; i++) {
        if (s[i] === "\r") count += 1;
    console.println("There are a total of "+ count + " carriage returns.");

  • How to count the number of text boxes that are data entered

    How to count the number of text boxes that are data entered in visual basic form.

    Here is an Iterator that expands on my previous response:
    ''' <summary>
    ''' Iterator for form controls
    ''' </summary>
    ''' <param name="onlyControlsOfType">specify type if a certain type of controls needed</param>
    ''' <param name="onlyTopLevel">if true don't search containers within the form</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Private Iterator Function AllControls(Optional onlyControlsOfType As Type = Nothing, _
    Optional onlyTopLevel As Boolean = False) As IEnumerable(Of Control)
    Dim ctrl As Control = Me.GetNextControl(Me, True)
    Do Until ctrl Is Nothing
    If onlyControlsOfType Is Nothing OrElse ctrl.GetType = onlyControlsOfType Then
    If TypeOf ctrl.Parent Is Form OrElse Not onlyTopLevel Then
    Yield ctrl
    End If
    End If
    ctrl = Me.GetNextControl(ctrl, True)
    Loop
    End Function
    Some sample uses:
    For Each
    For Each c As Control In AllControls()
    Debug.WriteLine(c.Name)
    Next
    List of all controls, including controls in containers i.e. Groupbox
    Dim l As List(Of Control) = AllControls().ToList
    List of all Textbox controls, including Textboxes in containers i.e. Groupbox
    l = AllControls(GetType(TextBox)).ToList
    List of all Textbox controls, don't include Textboxes in containers i.e. Groupbox
    l = AllControls(GetType(TextBox), True).ToList
    'Those who use Application.DoEvents() have no idea what it does and those who know what it does never use it.'  JohnWein
    Multics
    My Serial Port Answer

  • Text message to other than Telephone Number

    I can text to other iPhone users fine.  (Messages appear in blue dialogue bubbles)
    I can text to non-iPhone users if I have their ten-digit cellular phone number (the same one they use for voice calls)  (Messages appear in green dialogue bubbles.)
    What I can NOT do is send text message to a non-standard voice telephone number.  For example, before Twitter will connect my phone to my account, it wants to verify the phone, and has instructed me to text the word GO to an SMS address that is just 5-digits. 
    Any ideas?

    I type in the short address.
    I type in the message.
    I hit send. 
    The message appears in Message just like any anyother conversation thread when texting to a non-iPhone celluar phone number.  (My sent message is there on the right in a green dialogue bubble)
    But the message apparently never goes through to anyone.  It is not recieved by the addressee.  I do not get any kind of error or bounce back message indicating a problem or that it was undeliverable. 

  • Image number box above text box

    Do I need to delete the image number boxes that are above the text boxes in my hardcover, large book? I am assuming that those are just there for my use and will automatically not print when I send the book in, but thought I better check!
    Thanks!
    PS
    I have been reading discussions for a few days now (never knew anything about discussion forums) and I am so impressed with the communication and knowledge everyone is sharing--WOW!
    Power Mac G4   Mac OS X (10.3.9)  

    Harbs, thank you for your insight, you're helping me on my way closer to my goal!
    I think the idea of using Z-sorting would be most beneficial as with each line count I make in my [background] text box I can do a loop check for anything that has a value different from the text box itself.  I hadn't thought of that, thanks a lot!
    I don't suppose you've got any helpful hints as to how I can check for "soft returns" as opposed to "hard returns" do you?  Yes I'm  a total newb trying to teach myself InDesign scripting, and no I haven't found the command for this in the scripting manual, lol.  My luck I propoably read over it and was too confused to notice it, hehehe.
    As always, any help provided is *greatly* appreciated, complete with unnecessary grovelling
    Sincerely,
    -Arkonus

  • Is there a way to count the number of chars in a formatted text box?

    I have a formatted text box in my web dynpro for comments pertaining to workflow.
    in the backend, this is mapped to a char200 field.
    is there a way to have a running counter to let the user know how many chars are left? I'm not sure if there's an event to use for that.
    thanks,
    robert.

    Hello Robert,
    There is no way to get a running total of characters typed by the user - if you really need this functionality - consider creating an Adobe Flash Island.
    There was in the last year another thread which covered pretty much the same theme - it could be worth looking at that - although you will find that the eventual solution is the same as I suggest above.

  • Number of chars left in a text box

    Can anyone offer a solution for this please/
    I have a text box on a screen that is for example a maximum of 50 characters in this example.
    I want a display that tells the user how many characters they have left as they type into the box.
    You may have seen this type of feature on ebay when inputting feedback for instance.
    Sorry, not advertising, merely referencing.

    Hi Phil,
    APEX has such a feature too. At least for textareas (Type: Textarea with Character counter). Just check out the Javascript code APEX is generating for textareas and use it for your text field.
    Patrick
    Check out my APEX-blog: http://inside-apex.blogspot.com
    Check out the ApexLib Framework: http://apexlib.sourceforge.net

Maybe you are looking for

  • Login issue in both Oracle EBS and database

    My environment EBS --> R12.0.6 Platform -> AIX DB Node -> oracledb APPS Node -> app1 Issues: On DB Node: when trying to open alert log file getting following error against command: vi alert* ksh: 0403-030 The fork function failed. Too many processes

  • PURCHASE ORDER UPLOAD THRU BDC

    HOW MANY FLAT FILES 'LL U UPLOAD FOR PURCHASE ORDER IN BDC ND BAPI. i.e., WILL U GIVE SEPERATE FILE FOR HEADER DATA AND ITEM DATA OR A SINGLE FILE FOR BOTH. GIVE ME SOME SAMPLE CODES.

  • Can I use file names from some folder to specisfly a value of a variable

    so here is the thing I want to do: I've got like 3 variables in my swf file which value tells to the code how many picture there are to load. So I have like var totalPics:Number = 5 in my folder images I have 5 pics, but I want to put 3 more so I wan

  • Instance not accessible (ora-12514) and recovery..

    So, I was doing some changes on a network (from dhcp to fixed ip's), and after that I was not able to access my oracle (10.2.0) instance (win xp), and I don't know why. Of course, listener starts (and I can tnsping it), but when I start instance, no

  • Run in thread

    say a code like..... public static void main(String[] args) {     for(int i = 0; i < 5; i++)       new SimpleThread().start();     System.out.println("All Threads Started"); each of these threads run() method does calculation and insert DATA to DB ..