Proper Place to Add Phone Validation Script

I am attempting to add a javascript to validate a phone number in a form. Where is the best place to put it?
Under Properties, would it simply be under the Validate tab or the Action tab (creating a Mouse down to trigger the script?).
I  am no javascript guru but I found a nice script, courtesy of Steve L. Walker.  I can't seem t get it to work. Also, when does javascript normally kick in, as the user begins typing or upon exiting the field?

A validation script needs to be in the Validate tab, under Custom. However,
the script you found will not work as-is in a form created in Acrobat. It's
a script for a form created in LiveCycle Designer.
Buy why do you need a script, anyway? There are very easy to use built-in
options for enforcing a telephone number pattern under the Format tab.

Similar Messages

  • Validation Script for Dates and General Event Questions

    I have just started using Javascript, and am now using some objects and methods etc. that I did not even know about. It's progressing rather well, now I need to know some Livecycle Designer Basics that I can't seem to answer from my searches.
    Here's what I am trying to do in English:
    I want users to choose a date that they will miss at our Farmers Market. I have the date field on the form - works well.
    I want to validate the entry for:
    The date must be today or in the future
    AND
    The date must be before the closing date
    AND
    The date must be a Saturday
    Here's some script I've written and placed in the Validation Event (I have actually written more for testing out that the results are coming out properly):
    ----- form1.#subform[0].Missdate::validate - (JavaScript, client) ----------------------------------
    var entereddate = this.rawValue;// The date vendor will not attend as entered on the form
    var dentry = new Date(entereddate.slice(0,4),[entereddate.slice(5,7)-1],entereddate.slice(8,10),0,0,0); // month starts at 0!
    var closingdate = "October 04,2008" // closing date of the market
    var today = Date();// today
    (dentry.getDay() = 6);// and attempt to validate that the day = Saturday - nothing happens!
    But now -
    How do I actually validate this - my last statement seems to be ignored. How to I force a 'false' being returned? In Formcalc I simply put a camparison statement here and if it resulted in 'False' validation failed and if it resulted in 'True' it passed - What's the JS equivalent? Or are the variables giving me troubles?
    Maybe I'm putting this in the wrong Event? If so which one should I place it in.
    I want to force the user to enter the correct data - how do I code this - and put in a custom message refering to this. I may even get fancy and ask the user if the next Saturday is what they meant if they enter the incorrect one (this will be a real challenge!)
    I think I'm lacking some basic knowledge here that other posts have assumed. Please refer me to any help pages as well - although I've done extensive searching on this and have not really found a good explanation of Validation - only specific pages that are not basic or general enough for my understanding. Thank!

    In the validation script you have to allow the field's length to be 0, or
    it will not be possible to clear it...

  • Can Validation Script Discern If a Field is Hidden?

    Hello All
    I use the validation script below to check for data in required fields on my form. I recently modified the form, changing three of the required fields from visible to hidden fields. The three fields are hidden unless the user makes a specific selection from a combo box. Then the three fields become visible, and if visible, should be required.
    I am stuck on how to tell the script to work as follows:
    1. If the three fields controlled by the combo box are visible, then they should be checked for the required data
    2. If the three fields controlled by the combo box are hidden, then the script should ignore checking them for the required data
    The three hidden/unhidden fields in the script are f5, f6, f7. Is there a way in the validation portion of the script to have it determine if the field is hidden or visible, and if visible check it for the required data?
    Thanks in advance for any ideas on this.
    var m = this.getField("txt_subject");
    var mysubject = m.value + " - Request Form Submission";
    var cType = "Reader";
    var cVersion = "< 7";
    var nWarning = 1;
    var cMsg1 = "This form cannot be submitted with your version of Acrobat Reader.";
    var cMsg2 = "You must use Acrobat Reader version 7 or higher.";
    // If Reader 6 or below is being used, display message telling user that "Email" and "Save Data" buttons don't work.
    if (app.viewerType == cType && app.viewerVersion == cVersion)
    app.alert(cMsg1 + cMsg2, nWarning)
    else {
              f1 = this.getField("txt_date");
              f2 = this.getField("txt_requested by")
              f3 = this.getField("txt_requested by phone");;
              f4 = this.getField("cbo_functional area");
      f5 = this.getField("cbo_dmm_ad_spon");
              f6 = this.getField("txt_buyer");
              f7 = this.getField("txt_buyer phone");
              f8 = this.getField("cbo_dmm_finan_spon");
      f9 = this.getField("tbx_coop_dmm");
              f10 = this.getField("tbx_load_dmm");
              f11 = this.getField("tbx_expected roi");
              f12 = this.getField("txt_event");
              f13 = this.getField("txt_start date");
              f14 = this.getField("cbo_am or pm");
              f15 = this.getField("txt_target audience");
                                if (f1.value == "")
                        {app.alert ('Please enter the date you are making this request".');
              if (typeof app.formsVersion != "undefined" && app.formsVersion >= 4.0)
              f1.setFocus();}
                        else if (f2.value == "Person making request")
                                  {app.alert ('The "Requested by" line cannot be blank. Please type the name of the person requesting this ad.');
                if (typeof app.formsVersion != "undefined" && app.formsVersion >= 4.0)
              f2.setFocus();}
                        else if (f3.value == "Phone #")
                                  {app.alert ('Please type the phone number of the person requesting this project.');
                if (typeof app.formsVersion != "undefined" && app.formsVersion >= 4.0)
              f3.setFocus();}
                              else if (f4.value == "Select a Functional Area")
                                  {app.alert ('Please select a Functional Area.');
              if (typeof app.formsVersion != "undefined" && app.formsVersion >= 4.0)
              f4.setFocus();}
                               else if (f5.value == "Select a DMM")
                                  {app.alert ('Please select a DMM.');
              if (typeof app.formsVersion != "undefined" && app.formsVersion >= 4.0)
              f5.setFocus();}
                                        else if (f6.value == "Buyer's name")
                                  {app.alert ('Please enter the name of the Buyer.');
              if (typeof app.formsVersion != "undefined" && app.formsVersion >= 4.0)
              f6.setFocus();}
                        else if (f7.value == "Phone #")
                                  {app.alert ('Please type the Buyer\'s phone number.');
                if (typeof app.formsVersion != "undefined" && app.formsVersion >= 4.0)
              f7.setFocus();}
              else if (f8.value == "Select a Financial Sponsor")
                                  {app.alert ('Please enter the financial sponsor.');
              if (typeof app.formsVersion != "undefined" && app.formsVersion >= 4.0)
              f8.setFocus();}
                    else if (f9.value == "Enter dollars or a % amount.")
                                  {app.alert ('Please enter a dollar or percent amount for coop.');
              if (typeof app.formsVersion != "undefined" && app.formsVersion >= 4.0)
              f9.setFocus();}
                   else if (f10.value == "Enter a dollar amount.")
                                  {app.alert ('Please enter an amount for load.');
              if (typeof app.formsVersion != "undefined" && app.formsVersion >= 4.0)
              f10.setFocus();}
                   else if (f11.value == "Enter a dollar amount.")
                                  {app.alert ('Please enter the expected ROI amount in dollars.');
              if (typeof app.formsVersion != "undefined" && app.formsVersion >= 4.0)
              f11.setFocus();}
                   else if (f12.value == "")
                                  {app.alert ('Please enter the Event name.');
              if (typeof app.formsVersion != "undefined" && app.formsVersion >= 4.0)
              f12.setFocus();}
                    else if (f13.value == "")
                                  {app.alert ('Please enter a start date for this email.');
              if (typeof app.formsVersion != "undefined" && app.formsVersion >= 4.0)
              f13.setFocus();}
                 else if (f14.value == "Select AM or PM")
                                  {app.alert ('Please select AM or PM for the Deployment time.');
              if (typeof app.formsVersion != "undefined" && app.formsVersion >= 4.0)
              f14.setFocus();}
                    else if (f15.value == "")
                                  {app.alert ('Please describe the target audience for this email.');
              if (typeof app.formsVersion != "undefined" && app.formsVersion >= 4.0)
              f15.setFocus();}
                 else
                                  // Email PDF.
                                  this.mailDoc(true, "[email protected]", "", "", mysubject);}

    I went through the form, and realized I am partially where I need to be: The required fields script checks the first of the three unhidden fileds, but then skips the other two.
    To recap, I have a combobox that, if the user makes a specific selection, that selection will make three hidden fields visible. When checking the fields on the form, the required fields script should then proceed as follows:
    1. If the three fields controlled by the combo box are visible, then they should be checked for the required data
    2. If the three fields controlled by the combo box are hidden, then the script should ignore checking them for the required data
    The three hidden  fields are:
    cbo_dmm_ad_spon
    txt_buyer
    txt_buyer phone
    When the three fields are visible the script checks the first one, cbo_dmm_ad_spon, but skips checking txt_buyer and txt_buyer phone, and instead goes on to the cbo_dmm_finan_spon field.
    I believe I've correclty implemented what AcroBishop recommended. Does anyone see where I may have gone wrong?
    var correctVersion = (typeof app.formsVersion != "undefined" && app.formsVersion >= 4.0);
    var m = this.getField("txt_subject");
    var mysubject = m.value + " - Email Request Form Submission";
    var cType = "Reader";
    var cVersion = "< 7";
    var nWarning = 1;
    var cMsg1 = "This form cannot be submitted with your version of Acrobat Reader.";
    var cMsg2 = "You must use Acrobat Reader version 7 or higher.";
    // If Reader 6 or below is being used, display message telling user that "Email" and "Save Data" buttons don't work.
    if (app.viewerType == cType && app.viewerVersion == cVersion)
    app.alert(cMsg1 + cMsg2, nWarning)
    else {
              f1 = this.getField("txt_date");
              f2 = this.getField("txt_requested by")
              f3 = this.getField("txt_requested by phone");;
              f4 = this.getField("cbo_functional area");
      f5 = this.getField("cbo_dmm_ad_spon");
              f6 = this.getField("txt_buyer");
              f7 = this.getField("txt_buyer phone");
              f8 = this.getField("cbo_dmm_finan_spon");
      f9 = this.getField("tbx_coop_dmm");
              f10 = this.getField("tbx_load_dmm");
              f11 = this.getField("tbx_expected roi");
              f12 = this.getField("txt_subject");
              f13 = this.getField("txt_objective");
              f14 = this.getField("txt_start date");
              f15 = this.getField("cbo_am or pm");
              f16 = this.getField("txt_target audience");
                                if (f1.value == "")
                        {app.alert ('Please enter the date you are making this request".');
               if(correctVersion) f1.setFocus();}
                        else if (f2.value == "Person making request")
                                  {app.alert ('The "Requested by" line cannot be blank. Please type the name of the person requesting this ad.');
               if(correctVersion) f2.setFocus();}
                        else if (f3.value == "Phone #")
                                  {app.alert ('Please type the phone number of the person requesting this project.');
               if(correctVersion) f3.setFocus();}
                              else if (f4.value == "Select a Functional Area")
                                  {app.alert ('Please select a Functional Area.');
               if(correctVersion) f4.setFocus();}
                    else if(f5.display == display.visible && f5.value == "Select a DMM") {
      app.alert ('Please select a DMM.');
               if(correctVersion) f5.setFocus();}
                         else if (f6.display == display.visible && f6.value == "Buyer's name")
                                  {app.alert ('Please enter the name of the Buyer.');
               if(correctVersion) f6.setFocus();}
                        else if (f7.display == display.visible && f7.value == "Phone #")
                                  {app.alert ('Please type the Buyer\'s phone number.');
               if(correctVersion) f7.setFocus();}
              else if (f8.value == "Select a Financial Sponsor")
                                  {app.alert ('Please enter the financial sponsor.');
               if(correctVersion) f8.setFocus();}
                    else if (f9.value == "Enter dollars or a % amount.")
                                  {app.alert ('Please enter a dollar or percent amount for coop.');
               if(correctVersion) f9.setFocus();}
                   else if (f10.value == "Enter a dollar amount.")
                                  {app.alert ('Please enter a dollar amount for load.');
               if(correctVersion) f10.setFocus();}
                   else if (f11.value == "Enter a dollar amount.")
                                  {app.alert ('Please enter the expected ROI amount in dollars.');
               if(correctVersion) f11.setFocus();}
                   else if (f12.value == "Launch? Expanded assortment? New sizes?")
                                  {app.alert ('Please enter the subject of this email.');
               if(correctVersion) f12.setFocus();}
                                     else if (f13.value == "Drive sales? Informational?")
                                  {app.alert ('Please enter the objective of this email.');
               if(correctVersion) f13.setFocus();}
                    else if (f14.value == "")
                                  {app.alert ('Please enter a start date for this email.');
               if(correctVersion) f14.setFocus();}
                 else if (f15.value == "Select AM or PM")
                                  {app.alert ('Please select AM or PM for the Deployment time.');
               if(correctVersion) f15.setFocus();}
                    else if (f16.value == "")
                                  {app.alert ('Please describe the target audience for this email.');
               if(correctVersion) f16.setFocus();}
                 else
                                  // Email PDF.
                                  this.mailDoc(true, "[email protected]", "", "", mysubject);}

  • How to pass idoc parameters in a validation script? (10gR3 site studio)

    Obviously idoc won't work in the actual validation script, so I'd like to use it to generate the parameters to pass to a custom function.
    If I add <!--$siteId--> as a parameter in design mode, it'll be added as: &amp;lt;!--$siteId--&amp;gt; which doesn't work.
    If I manually add <!--$siteId--> to the parameter code in Source mode, this works just fine. However, once I enter design mode, Designer strips it out and now I have no parameter.
    Is there any way to somehow escape the less than/greater than symbols in Design mode?
    It's really unfortunate how the contributor windows are static HTML pages that don't retain what site they're on. Maybe this has changed in the 10gR4.

    Sorry I don't have an answer for you, but I wanted to say that we have had problems with Design mode in general and don't use it anymore. Switching between Source and Design has cause multiple errors in our Site Studio template. We do all of our Designer editing in Source mode. Any actual design work is done in an external editor and the HTML source is then brought over into Site Studio in Source mode.
    I was disappointed when 10gR4 came out and Oracle said they did no significant changes (improvements) to Site Studio Designer application.

  • FI-REFX Add additional validation to monthly posting

    Dear,
    We would like to add extra validations to the standard posting programs RERAOP/RERAPP (and their reversal programs RERAOPRV/RERAPPRV). These are standard SAP transactions within Real Estate to make (monthly) postings on the contract. Each contract contains a rental object (= the building or part of the building).
    An additional validation should be made on the profit center used in the posting (which is derived from the rental object) if the profit center is active for the company code used.
    If not active, it should not generate any posting for the contract in which the rental object/profit center is used and generate a standard error log - as done by the default program & give a detailed error message.
    The problem is that there is no user exit available/found to add an additional validation or to add an error message to the error hierarchy + to prevent the posting.
    We can add the error message to the error hierarchy in display (transaction SLG1), but not in the execution (update mode) of the program.
    Can anyone please advice on how to proceed to have this additional validation added please?
    Many thanks!
    Steps to reconst
    RERAPP or RERAOP with contract which contains a rental object that is linked to a profit center which is not active for a certain company code.
    Error message should be given: For contract X, profit center Y is not active for company code Z.
    Indicator should be red (error) and no posting should be made.
    Many thanks!

    Dear Pk,
    Thank you for your idea. Eventually this would be the way to go as the validation I need is indeed based on data in gl_je_lines in status other than 'P' - Posted.
    There are several posting programs that are called in several ways.
    The posting programs are:
    - Posting -- Executable: GLPPOS
    - Posting: Single Ledger -- Executable: Posting: GLPPOS
    - Program - Automatic Posting -- Executable: GLPAUTOP (this will submit the GLPPOS)
    The ways to post journals in GL (except SLA journals) are:
    - run the Program - Automatic Posting
    - push the "Post" button on the journal entry form
    - use the Jpurnal -> Post navigator function
    In this case the validation I need would imply the forms customization + custom posting wrapping program.
    I was looking for a way of adding one more validation to the standard list of validations for the GLPPOS executable as this is the only executable being responsible for posting in GL.
    Thanks again for your response,
    Cosmnin

  • Office 2013 VL and app-v 5 SP2 on RDS server - package add fails with script error

    We have used the MS Office Depolyment Tool for click-to-run to download the latest Office 365 version, and flatten it into an app-v 5 package - not a problem.
    When we try to add the package to our client machine (Server 2008R2 running the app-v 5 SP2 client software), it fails with an message that a script has failed and not returned a 0 code.  We have not added any scripting to this automatically created
    package, so it seems that the app-v client does not like the "official" package.  Any hints and tips gratefully accepted, thanks
    App-v client has scripting enabled.
    The powershell command line we are using is:
    PS C:\windows\system32> Set-ExecutionPolicy Unrestricted
    PS C:\windows\system32> Add-AppvClientPackage -path file://hostname/app-v/o365-noaccess/ProPlusVolume_en-us_zh-cn_x86.appv -DynamicDeploymentConfiguration \
    \hostname\app-v\O365-NoAccess\ProPlusVolume_en-us_zh-cn_x86_DeploymentConfig.xml
    with a result of:
    Add-AppvClientPackage : Embedded Script process exited with an error code indicating failure (return code other than 0). Please ensure that Embedded
    Script process can complete successfully and exits with 0.
    Operation attempted: Configure AppV Package.
    AppV Error Code: 100000000C.
    Please consult AppV Client Event Log for more details.
    At line:1 char:1
    + Add-AppvClientPackage -path
    file://hostname/app-v/o365-noaccess/ProPlusVolum ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~~
        + CategoryInfo          : InvalidResult: (:) [Add-AppvClientPackage], ClientException
        + FullyQualifiedErrorId : ConfigurePackageError,Microsoft.AppV.AppvClientPowerShell.AddAppvPackage
    and these are the error messages we see in the debug app-v client logs:
    Script Launcher successfully waited for script with command line: '"C:\ProgramData\App-V\D24C3BDD-8FAD-44D3-998C-933F8F053682\CD9725CE-4503-4932-863B-4FCDA3F9551D\Root\..\Scripts\Integrator.exe" /I /Msi /License /AppV PackageGUID=D24C3BDD-8FAD-44d3-998C-933F8F053682
    PackageRoot="C:\ProgramData\App-V\D24C3BDD-8FAD-44D3-998C-933F8F053682\CD9725CE-4503-4932-863B-4FCDA3F9551D\Root" MsiName=SPPRedist.msi,SPPRedist64.msi PidKey=xxxxx-xxxxx-xxxxx-xxxxx-xxxxx,xxxxx-xxxxx-xxxxx-xxxxx-xxxxx,xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
    PRIDName=ProPlusVolume'.
    and...
    Package {d24c3bdd-8fad-44d3-998c-933f8f053682} version {cd9725ce-4503-4932-863b-4fcda3f9551d} failed configuration in folder 'C:\ProgramData\App-V\D24C3BDD-8FAD-44D3-998C-933F8F053682\CD9725CE-4503-4932-863B-4FCDA3F9551D' with error 0x79100E10-0xC.
    and...
    machine script for event AddPackage with command line: '"C:\ProgramData\App-V\D24C3BDD-8FAD-44D3-998C-933F8F053682\CD9725CE-4503-4932-863B-4FCDA3F9551D\Root\..\Scripts\Integrator.exe"'
    exited with failure error code: The extended attributes are inconsistent.. Because Rollback is set to true in the script definition, the current AppV Client operation was rolled back.
    We believe this last error message is the kicker, but can't debug any further.

    Just to validate the problem, I started again.
    I have just downloaded the latest ODT from MS, and then downloaded the latest Office 2013 packaged - volume license.  Then created the app-v package - all went perfectly, no error messages.  Uploaded the package to the app-v 5 server and published
    it.  I have made NO changes to any of the files.
    I have just built a brand new Windows Server 2008R2 Datacentre VM, patched it to the hilt, and installed the RDS role, powershell 3 and appv 5.0 SP2 client for RDS.
    I then use powershell as above:
              scripting unrestricted
              app v client scripting enabled
             app v server added
              global and user update enabled
             add-appvclient package  "url of office package.appv"
                 and received exactly the same error message.  
    It is not complaining that scripting is not allowed, it is complaining that the script is invalid.
    Help!!!!

  • Error message on validation script

    Hi Guys,
        I created a validation script for MA to check the fill on the extention collection as below.
    productColln = doc.getExtensionCollection("PROD_HIER");
    productItr= productColln .iterator();
    for(member : productItr){
              if(!hasValue(member.get("fieldA"))){
                   exception.chainAtEnd(member.createApplicationException("fieldA","Please enter Max Value"));
              if(!hasValue(member.get("fieldB"))){
                   exception.chainAtEnd(member.createApplicationException("fieldB","Please enter the Unit Price"));
    if(exception.getChain() != null){
        throw exception.getChain();
        1. When the 'fieldA' and 'filedB' are blank, the error message is shown only for 'fieldA'. After i complete 'fieldA' the error message will be shown for 'fieldB'. It seem like it will show only for first one which is put in the chain. I would like the message to show all message in the chain.
        2. When the error message is shown the both fileds are covered by the red line but i would to have the red ' ! ' appear on the tab (ex. for product tab) as well. How can i implement that?
    Noppong,
    Thank you in advance

    Hi Noppong
    My understanding is once system gets an exception, it skips to throw statement and the subsequent exceptions, if any ,are skipped. Use of chain exception allows one to write one throw statement in the code rather than multiple throws at various points.
    I may be wrong so appreciate if someone can validate this.
    Regards
    Mudit Saini

  • How to validate a date in a validation script

    I have a date field for which I have set a validation pattern using its Object palette i.e. Object > Value tab > Validation Pattern > Validation tab. The validation pattern I have there is simply 'date{YYYY-MMM-DD}' with an error message set in the Validation Pattern Message box.
    How do I perform this same validation using a javascript in the Validation event?
    I'd like to use a script instead so that I can better control when this validation will be performed.
    Thanks!!
    Marc

    Marc:
    If your field has a display picture clause, then you can detect if it formatted correctly by looking at field.formattedValue
    Specifically, if the value cannot be formatted, the formattedValue will be the same as the rawValue (unformatted).
    So a validation script that specifies:
    this.formattedValue !== this.rawValue;
    should detect invalid dates.
    See: http://blogs.adobe.com/formfeed/2011/06/understanding-field-values.html
    good luck
      John

  • How to add a validator to a custom tag

    Hello,
    I would like to know how to add a validator to my custom tag as an attribute.
    <mytags:custom validator=???/>
    Thanks.
    Sebastien

    Are you wanting to use one of the JSF validators or a home brewed one?

  • Add file name script

    I have a script for adding the file name as a text layer in PS. This script called "AddFileName02.js" worked by placing the file in the scripts folder on the hard drive. This script worked for PS CS2 (and I think PS CS3). This script could then be accessed by <file><automate><scripts>
    Now that I have PS CS5 I have tried to place this script into the same place in PS CS5, but it does not appear. (I restarted PS) As I see it there could be two possible problems.
    1 The script has a .js extension and all other scripts in PS CS5 have a .jsx extention. So a newer version may be needed.
    2 I have placed the script in the wrong folder.
    Can anyone help?

    Just rename ist with the jsx-suffix and place it in the Presets > Scripts-folder.
    If that does not work you could try the Photoshop Scripting Forum, though some of the regulars also do drop by in this Forum.

  • How to place tif file through a script in an indesign document?

    how to place tif file through a script in an indesign document?

    Emanuele:
    it works if i just run a script....
    but since i have been using a gui to do some functions, this  place command is not able to place the output tif file back into the  document

  • How can i add multiple validations for a single input box in adf?

    hi,
    i want to add multiple validation for a single input text control in adf like number validation and its existence in database.
    MY JDEV VERSION IS 11.1.1.5.0
    pls help !!!!

    Hi,
    1.I want to validate if the value entered is pure integer
    Option 1-
    select the component and in the Property Inspector, in the "Core" category select a "Converter" format, select javax.faces.Number, if the user put a string, adf show a dialog error or message error...
    Option 2-
    or use the Regular expression:-
    http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_validateRegExp.html
    https://blogs.oracle.com/shay/entry/regular_expression_validation
    Also check this:-
    http://docs.oracle.com/cd/E15523_01/web.1111/b31973/af_validate.htm#BABHAHEI
    Option 3-
    Frank in his great book 'Oracle Fusion Developer Guide' shows a example using a javascript for input which is allowed only for numbers. You can manipulate for your requirement.
    Here is the code:
    function filterForNumbers(evt) {
        //get ADF Faces event source, InputText.js
        var inputField = evt.getSource();
        var oldValue = inputField.getValue();
        var ignoredControlKeys = new Array(AdfKeyStroke.BACKSPACE_KEY, AdfKeyStroke.TAB_KEY, AdfKeyStroke.ARROWLEFT_KEY, AdfKeyStroke.ARROWRIGHT_KEY, AdfKeyStroke.ESC_KEY, AdfKeyStroke.ENTER_KEY, AdfKeyStroke.DELETE_KEY);
        //define the key range to exclude from field input
        var minNumberKeyCode = 48;
        var maxNumberKeyCode = 57;
        var minNumberPadKeyCode = 96;
        var maxNumberPadKeyCode = 105;
        //key pressed by the user
        var keyCodePressed = evt.getKeyCode();
        //if it is a control key, don't suppress it
        var ignoreKey = false;
        for (keyPos in ignoredControlKeys) {
            if (keyCodePressed == ignoredControlKeys[keyPos]) {
                ignoreKey = true;
                break;
        //return if key should be ignored
        if (ignoreKey == true) {
            return true;
        //filter keyboard input
        if (keyCodePressed < minNumberKeyCode || keyCodePressed > maxNumberPadKeyCode) {
            //set value back to previous value
            inputField.setValue(oldValue);
            //no need for the event to propagate to the server, so cancel
            //it
            evt.cancel();
            return true;
        if (keyCodePressed > maxNumberKeyCode && keyCodePressed < minNumberPadKeyCode) {
            //set value back to previous value
            inputField.setValue(oldValue);
            evt.cancel();
            return true;
    2.I want to check if the value exists in my respective DB You must be having EO or VO if you want to validate with database in that case use the solution suggested by Timo.
    Thanks
    --NavinK                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Using SQL in a validation script

    Hi Experts!
    Can you give me an example code part of using a SQL select query in a validation script?
    My aim is to query an extension table with a parameterized select and extract a single field value,
    which can be used for further processing.
    Regards,
    Zolchee

    import com.frictionless.api.common.platform.IapiDbHandleIfc;
    dbHandle = session.getDbHandle();
    dbHandle.beginTransaction();
    sQuery = "SELECT DOC_DESCRIPTION " +
         "FROM " +
         "FCI_CUSTOM_MD2 " +
         "WHERE " +
         "EID = '" + sParameter + "'";
    dbHandle.executeQuery(sQuery);
    This is an example how the query should look like, but can you please tell me how to use the results of the query?
    Are the results stored in a ResultSet? How to extract them? The above query should return only one item - how to get that?

  • Entering a Not To Exceed Validation Script

    I am looking for a validation script that will not allow a user to enter an amount that exceeds an amount they previously entered in another form box.  For example, if the entered a value of 25000 in a cell named 'SchValue01', they could not enter 25001 in the subsequent cell.  I would need them to be able to enter an amount equal to the first though.  Can anyone advise me?  Thanks.

    George, never mind.  I found a discussion where you helped someone with the same issue last March.  The solution worked perfectly!  Thanks!
    John O. Ross, Jr.
    President
    DooleyMack Constructors of South Carolina, LLC
    1114 Morrison Drive
    Charleston, SC 29403
    843-762-6690 (Office)
    843-762-6691 (Fax)
    843-408-8587 (Mobile)
    www.dooleymack.com <http://www.dooleymack.com/> 
    The information contained in this e-mail message and any attachments is confidential and privileged information intended only for the use of individuals or entities named above.If the reader of this message is not the intended recipient you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail at the originating address.

  • Acrobat 6.0 validation scripts

    Hi
    I am new to scripting and need a little help with validating scripts.
    I use Acrobat Ver 6.0 to create simple editable pdf's.
    Some of the fields I want to set the validation such that they conform to the following:
    Standard text field are set to capitalise
    Postcode field to convert all letters to capitals
    On a seperate point, can someone point me in the direction of having an email button?
    When i have tried submit buttons in the past and saved the pdf; when opened again in pdf reader the security settings prevent the document being edited.

    The custom validate script would look something like:
    // Custom validate script
    event.value = event.value.toUpperCase();
    If you want to captialize as the user enters the text, you can use use the Keystroke event, but the script would be different.
    Note that Acrobat 6 cannot Reader-enable a document so that it can be saved, but it should still be fillable in Reader if it's not. Acrobat 8 was the first version that allow Reader-enabling. If you set up the submit form action so that only the form data is included, as opposed to the entire PDF, it does not need to be Reader-enabled.

Maybe you are looking for

  • I think I screwed up and "fixed" something I should not have

    Even the most proficient of us need to learn something new each day... In trying to track down a system slowdown, Leopard Cache Cleaner found a file named "msng" in my login items folder. Using the "reveal" feature did not find it belonging to any ap

  • Reciept element purchase requisition not appearing in  mrp order report

    Dear Gurus Receipt element purchase requisition is not appearing when I am trying to see the order report after running the mrp for the finished product .But the reciept element planned order is appearing for the semifinished products which are in th

  • SSL-Tunneling Problem with Stronghold

    Hello, I installed HTTP-Tunneling between a Java-Client and a WLS 4.5.1SP 13 throuch a Stronghold-Server using mod_wl_ssl.so. But when I'm trying to connect via HTTPS (port 443) to the Stronghold, the plugin is no longer working correctly. I get the

  • Keeping Validations in a user exit

    Hi folks,          I am trying to keep some validations for attachments in ME51N Tcode. Before saving the document, system will check for the attachment.If it is empty it will prompt a error message saying its mandatory.After seeing the message when

  • Help with number

    I want to check for numbers in a "IF statement". Say if I got 0-10000 as a value, I want to only check for value between 1000-10000.