Help needed to validate a text field

I'm using Acrobat X1 Pro and Live Cycle Designer ES4
I have a numeric text field to capture a blank or 14 digit number.
The display pattern is: null{}|num{zzzzzzzzzzzzzz}
The edit pattern is: null{}|num{zzzzzzzzzzzzzz}
The validation pattern is:
The data pattern id : null{}|num{zzzzzzzzzzzzzz}
I'm trying to make test that the user:
only enters numbers
enters nothing or a 14 digit number.
Display an error message and set focus back on the field for wrong entries.
This is the code:
topmostSubform.Page1.AU01::exit - (JavaScript, client)
// Test AU number format
var re = /^[0-9]{14}$/
//Allow blank space in field
if (event.value !="") {
  if (re.test(event.value) == false) {
    app.alert ({
       cTitle: "Incorrect AU Format",
       cMsg: "Enter a valid 14-digit AU number."
     getField("AU01").setFocus);
I get the error message when I exit the field regardless of what is in the field. And the set focus does not seem to work.
I can program in VBA but find Javascript challenging. What good reference books can you recommend?
May thanks.
Brian Dunkin

Hi,
With the first issue: having the dropdown and the first textfield displaying the same value, the easy solution is to use Global Binding.
Make sure that the dropdown and the first textfield have the same name in the hierarchy.
The select one of them and in the Object > Binding palette, set the binding to Global.
In the dropdown go to the Object > Binding palette and make sure that "Specify values" is NOT ticked.
It is probably a good idea to set the textfield to read only, in the Object > Value palette. This would prevent the user overwriting the value set by the dropdown.
No script required. Whatever is in the dropdpwn will appear in the textfield.
The second issue needs a small script in the calculate event of the second textfield. This looks at the value in the first textfield (TextField1) and sets its own value. This is JavaScript:
if (TextField1.rawValue == "Option B")
     this.rawValue = "Specific text";
else
     this.rawValue = null;
There are some examples here: http://assure.ly/jtTkdO, http://assure.ly/fYCuQ2.
Hope that helps,
Niall

Similar Messages

  • How to Validate the Text Field in JSF

    Hi,
    I am facing a issue to validate the text field where the below code accepts (space' ',underscore'_',pipe'|') symbol as a first character and last character.Where by it can accept in the middle.
    It should not accept special characters also. Below code is working properly for special characters.
    <tr>
    <td width="30%" align="right"><b><h:outputText id="aAccrualType" value="Accrual Type" /> </b> <span style="color:red">*</span></td>
    <td width="50%">: <h:inputText id="accrualType" value="#{accrualTypeMast.accrualType}" required="true" >          
    <t:validateRegExpr pattern="^[(a-z)||(A-Z)||(0-9)||(_)||(\s)||(/)]+$" />     
    <f:validateLength minimum="1" maximum="50"/>     
    </h:inputText>
    <h:message for="accrualType" showDetail="true" style="color:red" />
    </td>
    </tr>
    The thing is i dont have much knowledge in regular expression.
    Is there any other way to do this.
    Could anyone help me in this.
    Thanks,
    Ambika&#9786;

    This has nothing to do with JSF.
    I suggest you to read the Pattern API documentation [1]. You can easily create a small Java Application and test the regexp using String#matches() as it uses the same regexp guidelines.
    public static void main(String[] args) {
        String regexp = "^[a-z]+$";
        String value = "foo";
        boolean match = value.matches(regexp);
        System.out.println(value + " matches " + regexp + ": " + match);
    }[1] http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html

  • How to validate an text field item using javascript for numbers only.

    hi,
    how to validate an text field item using javascript for numbers only.please help me on this urgent
    please mail me solun if posible on [email protected]

    Hi,
    Page HTML header
    <script>
    function onlyNum(evt) {
      // Usage: onKeyPress="return onlyNum(event)"
      evt = (evt) ? evt : window.event;
      var charCode = (evt.which) ? evt.which : evt.keyCode;
      if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        var status = 'This field accepts numbers only!';
        alert(status);
        return false;
      var status = '';
      return true;
    </script>Item HTML Form Element Attributes
    onKeyPress="return onlyNum(event)"Br,Jari

  • How to validate a text field??

    Can any one tell me hot to validate a text field??
    I want to create a text field which holds alphabets only..

    You can use simple javascript code in the liveChange function such as the following (for sap.m.Input):
    liveChange: function(evt) {
    var inputValue = evt.getSource().getValue();
    this.setValueState(me.validateTagName(inputValue));
            this.validateTagName = function(inputValue) {
        if (inputValue.trim().length < 1) {
        return "Error";
        } else {
        return "None";
    Ran

  • Need to validate a existing field in the table maitainence Generator events

    Hi EXPERTS,
    There is one Z-table and for that TMG also there. There is custom transaction for sm30. Now I need to validate one field BNAME for new entries I have created event -05(creating new entry) it is validating correctly. But now another requirement is if user also wants to change the existing values for the field BNAME it should also be validated needs to populate error mesg and does not allow to save it. I used event 01(before saving data) 07 ( before correcting the contents of selected field) 18 ( after checking whether data has changed)but not working any of these events. Please suggest me which event is  suitable for my requirement. Orelse I need to put the code in the  flow logic of the screen under PAI module I think this is not a good practice.
    Code:
    FORM data_changed.
      DATA     : l_bname TYPE xubname.
      CONSTANTS: c_mesg      TYPE char16   VALUE 'Invalid SAP User',
                 c_error     TYPE char1    VALUE 'E'.
    * Validation on BNAME field
      IF zps_capex_appr-bname IS NOT INITIAL.
        SELECT SINGLE bname FROM usr01 INTO l_bname
               WHERE  bname = zps_capex_appr-bname.
        IF sy-subrc NE 0.
          MESSAGE c_mesg TYPE c_error.
        ENDIF.
      ENDIF.
    ENDFORM.                              "DATA_CHANGED
    Please suggest me how to proceed.
    <Added code tags>
    << Priority normalized >>
    Awaiting for your replyu2026
    Thanks in Advance.. 
    Edited by: Rob Burbank on Mar 2, 2012 9:23 AM

    Hello Sreekanth,
    How are you populateing the field zps_capex_appr-bname ? I'm pretty much sure that this is not getting populated at runtime.(put a break-point & check)
    In order to access the data in the TMG [Event01|http://help.sap.com/saphelp_nw04s/helpdata/en/91/ca9f0ba9d111d1a5690000e82deaaa/content.htm], we have to use the TMG system tables - TOTAL & EXTRACT.
    If your validation of BNAME fails, remember to:
    1. Set SY-SUBRC to a non-zero value,
    2. Set the flag VIM_ABORT_SAVING to 'X'.
    BR,
    Suhas

  • Please Help me with FormCalc Customized Text Field

    A while ago someone online did a great thing for me- they helped me create a Text field that would type "This document was printed on _________" and include whatever day the pdf form was printed off our employer's intranet site.
    I had a shortcut to it in my favorites and would click on it and plave it on every new document I needed it to be on.
    Since the computer I was using suddenly crashed, I cannot find the details of how to set this up again. I have a pdf form that includes the box, but when I open it in LiveCycle, it is just blank.
    This is what I saved:
    <field h="8.4935mm" name="PrintedOn" w="141.0398mm" x="-0.0001mm" y="0mm" xmlns="http://www.xfa.org/schema/xfa-template/2.5/">
       <ui>
          <textEdit>
             <border hand="right" presence="hidden">
                <?templateDesigner StyleID aped0?></border>
             <margin/>
          </textEdit>
       </ui>
       <font size="18pt" typeface="Tahoma" weight="bold">
          <fill>
             <color value="221,221,221"/>
          </fill>
       </font>
       <para hAlign="center" vAlign="middle"/>
       <bind match="none"/>
       <event activity="prePrint" ref="$host">
          <script>$.rawValue = concat("This document was printed on: ", num2date(date(), DateFmt(1)));</script>
       </event>
    </field>
    I do not remember what to do to get this working.
    I use this "Printed On" textbox ALL the time, and I need to figure out what to do to get it working again quickly.
    If there is anyone who could help me, I could also send you a sample of a form that includes it- then you can see exactly what I mean.
    If someone could remind me how to program this kind of thing in once again and save it in LiveCycle, then explain how I can put it on another computer as well, I would really, REALLY appreciate it.
    ~Chris
    PS- this one as I had it set up only prints the Printed on message/date on the first page. If it could somehow print on EVERY page of the PDF without me having to click and add it to every single page individually, that would be even better... but first things first!

    Great, got it working!
    Now just wondering, is there any way for this to appear on every page, or would I have to place this box on every page?
    I have ~20 page documents and I have had requests to have this "printed on" show up on every page, but doing so seems like ti would be very time consuming.

  • I created a Custom list New Form and need to make the text fields read only

    When I use SharePoint Designer and add the read only attribute  to the  SharePoint form field, then it throws  a web part error.
    but here is the thing, I have current user Filters populating the Form Fields. So the form fields  populate First name , last name etc. and I need these fields read-only....
    the Client doesn t want the end user to Change those fields.  Is there any way to "LOCK" the form fields?
    As I have only 7 text fields that need to be locked down. and one field is a signature line that is a true input field.. where the  user has to inter their initials.
    Any ideas? as I have tried most of the items available thru searches nothing works, or it throws that web part error message.
    Steve Athey

    Daniel: ( I'm now at work, a different ID is logged on for me)
    I used SharePoint Designer.
    Steps:
     created a web part page
    then on the SharePoint Designer ribbon I then went to insert:
    new item form
    Then I selected my data source (list)
    then I placed the 8 columns on the page
    a page viewer web part to pull the manual that people have to read.
    and 7 current user filter webparts. (1 for each form field) Yes it is over kill, but I'm trying to keep this straight out of box as much as possible...
    then for the form fields
    I added a parameter and the read only tag see below in bold:
    <asp:TextBox runat="server" text="{$ParamEmployID}" id="ff17{$Pos}" __designer:bind="{ddwrt:DataBind('i',concat('ff17',$Pos),'Text','TextChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Employee_x0020_ID')}" 
    ReadOnly="True" />
    I also  added the parameters in the ribbon area
    the error message doesn't tell me much, it just send me to web part maintenance page... 
    if I removed the  ReadOnly = True then the error  goes away.....   So I was trying to find a  quick simple  JQuery and or javascript   code item that would  make  the 7 text fields readonly and leave the
    8th  text field alone  to allow people to place their initials on the page to say that they read the manual.
    I have  created hundreds of these types of pages .. this is the first time I have run into this issue, but it also the first time I have tried to use the ReadOnly = True item.
    Any Ideas  and or thought on how to make the  items read only? and not throw the error.
    Steve

  • Needed scroll bar in text field

    Hi,
    I have two text fields continuously. Sometimes either one get expanded. I kept all the fields in subform type positioned. Comments fields are getting enlarged when it has more number of lines. Lets say, If first field get expanded, it override the second one.
    so I want to give scroll bar in a text field.
    Thanks in advance.
    Ram

    You should not use positioned subforms at all. If you need to move a field right for example, the wrap it into a subform and set the left margin of the subform. Do not use positioned subform and just move the field. You will probably resolve your problem if you remove content: positioned on all subforms relevant to your problem (for example all parents of the text fields).
    Use content flowed and layout autofit as often as possible!
    Otto

  • Help - Need to save group text - story of daughter's life

    Hello and thank you in advance.  This may be a very dumb question, but I can't seem to find an easy solution in the research I have done.
    I have used a group text since the birth of my daughter to update family members on her life.  This group text is now basically the story of her life with pictures, things she has done, funny things she has said... I don't want to lose any of that.  However, my iPhone 4S 64G is now maxed on storage due to this group text.  I need to save this somehow, but don't know how to go about it.  I have backed up my phone many times, but now that I need to delete the text to gain storage capacity.  I don't want it to override the backup next time with the deletion.  I need to keep the history.
    Any suggestions on how I can go about that?
    I have purchased a program called DiskAid, but have not had time to see if it will suit my needs.
    Thank you,
    A mommy desperately in need of help!

    Hi Maggie,
    I would try the software decipher text message. It will let you save your text messages to your computer so that you can safely archive all the sms conversations between you and your family. 

  • Help: need to insert body text in e-mail of remittance advice

    Hi all,
    I am sending remittance advices via the standard output program RFFOAVIS and want to include body text in the e-mail which is sent.
    There is an OSS note for dunning (I know it's a different process) which mentions creating a text with text ID = 'FIKO' in transaction SO10 and then setting the field  c_finaa-namep to the name of the custom text inside a function linked to the dunning business transaction. Can't find anything informative on OSS about body text for Remittances.
    I have created a custom function linked to process 00002040 in transaction FIBF and changed the value of c_finaa to refer to custom text  . I was able to change the recipient e-mail address inside this function (ie. the function is being called successfully) and the remittance itself is correctly output as an attachment but nothing comes out in the body text.
    Can anyone out there help ? Any other field which one needs to change to include body text ?
    Regards,
    Gabriel

    Hi,
    do you mind share with me how did you implement the Automatic email of remittnance advice to vendor after payment run?
    I am in process research this solution. appreaciate if you can share with me if you have any info.
    +91 9791122480
    Thanks in advance.
    regards
    v.krishnamoorthy

  • Help needed in formating the text using HTML tags in reports 10g

    Hi all,
    I have a situation here. We have an application which prints out Reports with a few lines of text in it. This text is entered by the user through our forms application in a field. That particular text is stored in each row of a particular long column. Here I want to modify the text, while printing, on the report like underline, bold, italics etc,.
    As of now I am using the HTML tags, in the forms, to do so as most the times the text in the report is same.
    I want to know if this can be done by the user itself while he is entering the data in the field through the form.
    Thanks in advance . I will explain you more clearly if you need.

    Hi,
    The code did work. But I am not sucessfully able to display the values entered in 2nd page in the 3rd page.Please find the code below:
    <html>
    <head>
    <script language="LiveScript">
    function WinOpen() {
    if (document.form1.cap.value == "")
    alert("Enter value in text box");
    return;
    msg=open("","DisplayWindow","toolbar=no,directories=no,menubar=no, scrollbars=yes");
    msg.document.write("<HTML><HEAD><TITLE>Yo!</TITLE></HEAD>");
    msg.document.write("<CENTER><h1><B>This is really cool!</B></h1></CENTER>");
    msg.document.write('<BODY><form name="form2">');
    for(var i =0; i < document.form1.cap.value; i++)
    msg.document.write("<INPUT type=text name=tbAlphaNumeric>");
    msg.document.write("<br>");
    msg.document.write('<input type="button" name="Button2" value="Steal" onClick="javascript:window.opener.WinShow();">');
    msg.document.write('</form></BODY></HTML>');
    function WinShow() {
    msg=open("","DisplayWindow","toolbar=no,directories=no,menubar=no, scrollbars=yes");
    msg.document.write("<HTML><HEAD><TITLE>Great!</TITLE></HEAD>");
    msg.document.write("<CENTER><h1><B>Display of second page text elements!</B></h1></CENTER>");
    msg.document.write('<BODY><form name="form3">');
    for(var j =0; j < document.form1.cap.value; j++)
    msg.document.write(document.form2.tbAlphaNumeric[j].value);
    msg.document.write("<br>");
    msg.document.write('</form></BODY></HTML>');
    </script>
    </head>
    <body>
    <form name="form1">
    <INPUT type= "text" name=cap>
    <input type="button" name="Button1" value="Push me" onClick="WinOpen()">
    </form>
    </body>
    </html>

  • Help needed on adding 2 new fields.

    Hi gurus,
    I have a existing data model which is from the flatfile to ods to cube. The new user requirement is for 2 new fields which would be based on a existing field that is already there in the data model. the change is going to be based on a existing field that is field A.
    The user have now provided with a new flatfile which is a lookup table, this flatfile this flatfile relates the existing field A with new fields Field B and C. the way in which the fields A,B and C are related are Field A is the lowest catagory in the hierarchy and field B is a sub catagory and Field C is the main catagory.
    i need to bring in these 2 new fields can out there help me out on how to handle this scenario. the lookuptable they have provided me is static and it is a flatfile table.
    FIELD A FIELD B FIELD C
        A                  A1            B1
        B                    A1           B1
        C                   A1            B1
        D                   A2            B1
        E                   A2            B1
        F                   A2            B1
       G                    A3            B2
       H                    A3             B2
    Points will be given.

    Hi,
    Relationship which you are pointing out is like parent-child.
    You can maintain field A as masterdata bearing with Field B & C
    as navigational attributes of it. Even it infoprovider you make it as Navigational.
    Hope this thought will hepl you solve your prob.
    Bobby

  • How to validate empty Text Field?

    Hi,
    I am Thirupathi,
    I am new to JSF. I am able to validate the value of a component which has some value using attribute
    validator="#{UserNumberBean.validate}"
    in this case it is calling validate method of UserNumberBean.
    but if i keep the field empty then it is not calling that validate method of UserNumberBean.
    Please can any one clarify my doubt.
    wait for reply
    Thanx in advance.
    Thirupathi Reddy
    mail Id: [email protected]

    validate method is called to validate the correctness of the value input by user (eg. email format, phone numebr etc.). If user leaves the input box empty then there is nothing to validate and so validate is not called.
    If you want customised messages for required fields you can use requiredMessage attribute in your inputText tag provide that you are using JSF1.2. It is not available in JSF1.1. In JSF1.1 it is requires some extra coding. You can do like this :
    In your managed bean
    public class MyBean {
        private String userName = "";
        private String password = "";
        private ArrayList errors = new ArrayList();
        public String getErrors() {
            String message;
            if (errors.size() == 0) {
                message = "";
            } else {
                message = "<FONT COLOR=RED><UL>\n";
                for(int i=0; i<errors.size(); i++) {
                    message = message + "<LI>" +
                            (String)errors.get(i) + "\n";
                message = message + "</UL></FONT>\n";
            return(message);
        public String validateUser() {
            errors.clear();
            if (userName  == null || userName.trim().length() == 0) {
                errors.add("User Name is required");
            if (password == null || password.trim().length() == 0) {
                errors.add("password is required");
            if (errors.size() > 0) {
                return(null);
            } else {
               //perform your logic here
               return("returnString");
    }In your jsp page, include the errors tag as below. It will show all errors on top of the page.
    <f:view>
            <h:form>
                <h:outputText value="#{MyBean.errors}" escape="false"/>
                <p>User Name: <h:inputText value="#{MyBean.userName}" /></p>
                <p>Password: <h:inputText value="#{UserBean.password}" /></p>
                <h:commandButton value="Login" action="#{UserBean.validateUser}" />
            </h:form>
        </f:view>One point to remember is to clear the errors List in every action.
    Hope it helps.
    -Hitesh

  • Automator Help - Need script to send text to an existing document

    Hi,
    Automator Newbie Alert. I need help with a basic automator script. I would like to highlight some text, right click and send to an existing document. Adding the text on a new line. Is this possible?
    Thanks

    Sorry, I agree. It will update Style Library and other out of the box ones. Include the library titles in a collection and run the update against them provided these libraries are common across all sites. If not, you will have to first get an extract of
    all such libraries in all sites say in a CSV file and then update the script below to refer to the CSV records.
    Add-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction Stop;
    #List of Libraries to be updated.
    $Libraries = @("Shared Documents","My Document Library");
    $spAssgn = Start-SPAssignment;
    $site = Get-SPSite http://site -AssignmentCollection $spAssgn
    #Walk through each site in the site collection
    $site | Get-SPWeb -Limit ALL -AssignmentCollection $spAssgn |
    ForEach-Object {
    #Enumerate through all document libraries
    $_.Lists|Where{$_.BaseTemplate -eq "DocumentLibrary" -and $Libraries -contains $_.Title}|Foreach-Object{
    #Get the list in this site
    $list = $_;
    #Create a version each time you edit an item in this list (lists)
    #Create major versions (document libraries)
    $list.EnableVersioning = $true
    #Create major and minor (draft) versions (document libraries only)
    $list.EnableMinorVersions = $true
    #Keep the following number of versions (lists)
    #Keep the following number of major versions (document libraries)
    $list.MajorVersionLimit = 7
    #Keep drafts for the following number of approved versions (lists)
    #Keep drafts for the following number of major versions (document libraries)
    $list.MajorWithMinorVersionsLimit = 5
    #Update the list
    $list.Update()
    Stop-SPAssignment $spAssgn;
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • Need to add new Text Field on the Screen

    Hi,
    I am using Oracle 9 Designer and generating the web pages using web pl/sql language. After I generate the page, my screen looks like this:
    Employee id: TextField
    Employee Name: TextField
    I want to add a comment"(Please enter characters Only" below the Employee ID like the following:
    Employee id : TextField
    (Please enter characters Only)
    Employee Name: TextField
    Can anybody help me how to add this in the designer form?
    thanks in advance.

    You can do this with an unbound item on a View Form. You cannot do it at all for an Insert Form. There is a work around but takes a little explaining for the Insert Form. You need to create a web page from the insert form html, modify it manually. I do it as a simple procedure so it is consistent with the rest of the application. Then all menus, links, etc. need to reference that page instead of the FormInsert procedure in the generated package.
    There may be other work arounds. Without knowing more about your requirements, I can't say.
    John Caputo
    [email protected]

Maybe you are looking for

  • OS Reinstallation on Portege 2000 with non IDE CD-ROM

    Hello, I recently received from my Dad a Portege 2000 (bought in Japan if that makes a difference) on which I am trying to reinstall Win XP from the provided Recovery CDs (there are 3 CDs containing Win XP Pro and Win 2000). I am trying to do this wi

  • Unable to customise Tab (color) in Portal Theme through Theme Editor

    Hi Everyone , I m working  on Themes in Portal 7.0 . I have customised the theme but dont know why i m not able to customise Tabs (Color) . Like When u click on System Administration ->System Configuration ->system landcape -> (There is second menu w

  • IMAP-Mail sender adapter handling with read messages in mailbox

    Hi, (PI 7.0) we have a "funny" situation: We are using imap-mail-sender adapter polling a mailbox. Sometimes there are read messages in mailbox so the adapter cannot read these messages. When we sort all read messages and we mark e.g. the second mess

  • What is a business area???

    hi experts explain me wat is a business area. thanks Neha

  • Did upgrading to Lion ruin my bluetooth experience?

    After upgrading to Lion my snaptooth bluetooth headsets would not connect to my iMac or macbook pro.  For Christmas, I received new bluettoth headsets from Motorola (S305) and they don't work either.  WTH?  These devices conect to EVERYTHING except m