How to validate user input

Hi,
I am new to Form design
I am designing an offline form I just want to validate the user input
whether user has entered Character or Numric.
if user enters characters in phone no I have to give an error message.
can you please give the pice of the script to validate the user input.
Regards
Bikas

Instead of finding what is the type of input, you can restrict the user not to type characters in Phone No field.
Place the below code in Change event of the Phone No field with Java Script as language. 
// restrict entry to digits
if (xfa.event.change.match(/[0-9]/) == null)
     xfa.event.change = "";
Note: You have placed the question in the wrong forum.. You might need the Designer ES forum.
Thanks
Srini

Similar Messages

  • How to validate user input field?

    I need to validate a user input field against a table. This field is not part of an EO but is used to update an attribute on an existing EO.
    My question is, where would I place the sql that would validate the user input value against the table?
    Is there an easy way to do this?
    I'm at a roadblock and really need some help. Thank you.

    You can execute a sql query or a function from <your>AMImpl.java, using normal jdbc.
    but I would recommend this, it is easier and cleaner approach
    1. Create a VO (<your>VO) with the sql statement
    Select client
    from client_table
    where resp_id = :1
    and client= :2
    2. Add this vo to the am
    3. In AMImpl, get handle to the VO (this.get<your>VO1)
    4. Bind params
    this.get<your>VO1().setWhereClauseParams(0,current_resp );
    this.get<your>VO1().setWhereClauseParams(1,user_input_value);
    5. Execute the query
    this.get<your>VO1().executeQuery();
    6. Get the row after the query is executed
    oracle.jbo.Row <your>Row = this.get<your>VO1().first();
    7. Get the value of the attribute from the row
    l_client = <your>Row.getAttribute("Client") ;
    8. So now you have what you wanted to do with the sql.
    Thanks
    Tapash

  • Captivate 6 How to validate user input without using keyboard shortcuts

    I've been using Adobe Captivate 6 for about 4 months now.  Completely new to the program.  The number one function of Captivate for me will to create many software simulations for verifiable training.  This means that I will be utilizing the training and assessment modes A LOT.  I have run into many hurdles throughout the process, but one of my biggies right now is this:
    In the training and assessment modes, I have times where the user must input data such as an address or number.  In the actual software they will be utilizing it is not always required to use TAB or ENTER in order to move to the next field.  In some instances, it will be necessary to actually click into a field after entering data.  My problem is that it seems as if Captivate will not allow this,  as a keyboard shortcut is automatically entered even if a TAB or ENTER is not required after input.  I assume this is so that the inputted information can be verified.  If you decide you do not want to use a keyboard shortcut to validate the inputted information, you must have a submit button.  Is there any way to change this??  All I want is for the user to enter information and then click into another field WITHOUT having to press ENTER, TAB, or hit a submit button.  Is this even possible if you need user input to be validated??  Any ideas or suggestions would be much appreciated!!

    Hello,
    A while ago I explained the work flow I’m using often in that case, only for the last field you need to have either a shortcut or a submit button AND the sequence has to be imposed. The idea is that you make the Submit button for the first field transparent, delete the  ‘Submit’ text and put it over the second field. So if the user clicks on the second field, he also submits the value of the first field.
    Here is the blog post I’m referring to:
    http://lilybiri.posterous.com/one-submit-button-for-multiple-text-entry-box
    Although it was written for previous versions, the idea will still be functional.
    Lilybiri

  • How to validate user inputs against checktables

    Hi all,
    how to validate userinputs for s_bukrs and s_hkont  against respective check tables(t001 and skb1).
    can u pl zprovide me codeing for this validations.
    very urgent.
    thanks in advance
    swathi

    Hi
    Write the report
    REPORT ZREPORT.
    tables: t001,skb1,
    select-options: s_bukrs for t001-bukrs,
                           s_hkont for skb1-saknr.
    AT SELECTION-SCREEN.
    Validate the screen fields
      PERFORM validate_screen.
    *&      Form  validate_screen
    Validation of Selection Screen fields
    FORM validate_screen .
    Validation of Company code
      CLEAR t001-bukrs.
      IF NOT s_bukrs[] IS INITIAL.
        SELECT bukrs UP TO 1 ROWS
            INTO t001-bukrs
            FROM t001
            WHERE bukrs IN s_bukrs.
        ENDSELECT.
        IF sy-subrc <> 0.
          MESSAGE e000 WITH 'Company code'(002).
        ENDIF.
      ENDIF.
    Validation of Account Number
      CLEAR skb1-SAKNR.
      IF NOT s_SAKNR[] IS INITIAL.
        SELECT SAKNR  UP TO 1 ROWS
            INTO skb1-SAKNR
            FROM skb1
            WHERE SAKNR IN s_SAKNR and
                         bukrs    in S_BUKRS.
        ENDSELECT.
        IF sy-subrc <> 0.
          MESSAGE e000 WITH 'Invalid Account Number'(003).
        ENDIF.
      ENDIF.
    ENDFORM.
    Reward points if useful
    Anji

  • How to get User input in JTextField?

    How to get User input in JTextField? Can u anyone give me some code samples? thanks

    read the API!!!

  • How to validate user name and password in webdynpro.

    Dear All,
    Actually i have created login name and password in view, webdynpro and want to validate the user name and password but  i am not finding proper code to  how to validate user name and password.
    Pl do the needful help.
    Regards.
    Tazeer.
    Moderator Message: There is a seperate forum for WebDynpro. Please ask your question there.
    Edited by: kishan P on Oct 5, 2010 1:08 PM

    Hello, I don´t get you question. User authentication is ready out of the box in webdypro...
    Regards Otto

  • How to take user input and place it in a variable

    All I want to know is how to copy user input from the message pop up and store in a local variable?
    Thanks.

    Hi
    Just take a look at thread's example
    http://forums.ni.com/t5/NI-TestStand/TestStand-Message-Popup/m-p/1792424/highlight/true#M35397
    The trick is done by Message-Popup PostExpression: Locals.strMyResponse = Step.Result.Response
    Hope this helps
    Juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

  • How to get user input to keep in array in the form of int[]?

    I really want to know how to get user input to keep in an array. Or if it's impossible, can i use the value in "int" and transfer it to an array?

    What I understand is that you want to set an input from the user in an array of int.
    Here is how it work:
    1. Create a stream and a buffer to get and store the informations entered by the user:
    BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
    2. Set this input in a String:
    String input = stdin.readLine();
    3. Set this string in an int:
    int userInput = Integer.parseInt(input);
    4. Then you can put this int in the array.
    Warning this code throws IOExceptions and NumberFormatException ( when you try to set letters as int ). But you can catch them easily.

  • Validate user input in textfield?

    Am trying validate user input into my JTextfield but its not working right... Am using the classes from sun's hp :
    http://java.sun.com/docs/books/tutorial/uiswing/components/textfield.html
    The classes with changes made:
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.Toolkit;
    import java.text.*;
    public class DecimalField extends JTextField
    private NumberFormat format;
    private NumberFormat percentFormat;
    public DecimalField()
    super(10);
    percentFormat = NumberFormat.getNumberInstance();
    percentFormat.setMinimumFractionDigits(2);
    // ((DecimalFormat)percentFormat).setPositiveSuffix(" ");
    setDocument(new FormattedDocument(percentFormat));
    format = percentFormat;
    public double getValue()
    double retVal = 0.0;
    try
    retVal = format.parse(getText()).doubleValue();
    } catch (ParseException e)
    Toolkit.getDefaultToolkit().beep();
    return retVal;
    public void setValue(double value)
    setText(format.format(value));
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.Toolkit;
    import java.text.*;
    import java.util.Locale;
    public class FormattedDocument extends PlainDocument
    public FormattedDocument(Format f)
    format = f;
    public Format getFormat()
    return format;
    public void insertString(int offs, String str, AttributeSet a)
    throws BadLocationException
    String currentText = getText(0, getLength());
    String beforeOffset = currentText.substring(0, offs);
    String afterOffset = currentText.substring(offs, currentText.length());
    String proposedResult = beforeOffset + str + afterOffset;
    try
    format.parseObject(proposedResult);
    super.insertString(offs, str, a);
    } catch (ParseException e)
    Toolkit.getDefaultToolkit().beep();
    // System.err.println("insertString: could not parse: "
    // + proposedResult);
    public void remove(int offs, int len) throws BadLocationException
    String currentText = getText(0, getLength());
    String beforeOffset = currentText.substring(0, offs);
    String afterOffset = currentText.substring(len + offs,
    currentText.length());
    String proposedResult = beforeOffset + afterOffset;
    try
    if (proposedResult.length() != 0)
    format.parseObject(proposedResult);
    super.remove(offs, len);
    } catch (ParseException e)
    Toolkit.getDefaultToolkit().beep();
    // System.err.println("remove: could not parse: " + proposedResult);
    private Format format;
    what am I doing wrong?

    am sorry
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.Toolkit;
    import java.text.*;
    import java.util.Locale;
    public class FormattedDocument extends PlainDocument
        public FormattedDocument(Format f)
            format = f;
        public Format getFormat()
            return format;
        public void insertString(int offs, String str, AttributeSet a)
        throws BadLocationException
            String currentText = getText(0, getLength());
            String beforeOffset = currentText.substring(0, offs);
            String afterOffset = currentText.substring(offs, currentText.length());
            String proposedResult = beforeOffset + str + afterOffset;
            try
                format.parseObject(proposedResult);
                super.insertString(offs, str, a);
            } catch (ParseException e)
                Toolkit.getDefaultToolkit().beep();
    //            System.err.println("insertString: could not parse: "
    //            + proposedResult);
        public void remove(int offs, int len) throws BadLocationException
            String currentText = getText(0, getLength());
            String beforeOffset = currentText.substring(0, offs);
            String afterOffset = currentText.substring(len + offs,
            currentText.length());
            String proposedResult = beforeOffset + afterOffset;
            try
                if (proposedResult.length() != 0)
                    format.parseObject(proposedResult);
                super.remove(offs, len);
            } catch (ParseException e)
                Toolkit.getDefaultToolkit().beep();
    //            System.err.println("remove: could not parse: " + proposedResult);
        private Format format;
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.Toolkit;
    import java.text.*;
    public class DecimalField extends JTextField
        private NumberFormat format;
        private NumberFormat percentFormat;
        public DecimalField()
            super(10);
            percentFormat = NumberFormat.getNumberInstance();
            percentFormat.setMinimumFractionDigits(2);
    //        ((DecimalFormat)percentFormat).setPositiveSuffix(" ");       
            setDocument(new FormattedDocument(percentFormat));
            format = percentFormat;
        public double getValue()
            double retVal = 0.0;
            try
                retVal = format.parse(getText()).doubleValue();
            } catch (ParseException e)
                Toolkit.getDefaultToolkit().beep();
            return retVal;
        public void setValue(double value)
            setText(format.format(value));
    }Well when I create this overriden TextField ( DecimalField ) its working as it should with the first character. Its only accepting digits and . but after the first character its accepting everything. Its like the validation disappear?

  • Validate user input

    How do I validate the data that the user inputs through the prompts? Example: End date is not earlier than start date, or End Date - Start Date <= 12 months?
    Any direction is appreciated

    Denzil,
    One way to "validate" the data would be to populate a back-end table that has the combinations of data you want users to invoke as they run a report.  Another way would be to set up an alerter in the report and when the undesired condition is met than a cell would show up stating the problem, but this solution appears after the report runs and is handled within the reporting tool.  Not very easy answers, just some choices for you to think about.
    Thanks,
    John

  • How to capture user input for customer exit processing?

    I need to calculate the number of working days elapsed in the current fiscal quarter BASED on the USER INPUT on the reporting front.  i.e., say the fiscal quarter started on 1 July 2005 and if the user enters 10 July 2005, I should get the value 8 (Assume that Monday through Friday are all workdays).  If the user enters 12 July 2005, I should get 10.  I have written customer exits and know how to use factory calendar, but <b>THE CHALLENGE</b> is how do I <b>CAPTURE</b> the user input and use it in my exit?  During the varible definition, if I select the check box "Ready for input" then the customer exit is not being processed and unless I check that box I can't get a user entry!  If I look at the import values in the customer exit, I see i_t_var_range with type rrs0_t_var_range.  My strong feeling is that this parameter gets the user input, but I am unable to use it as the customer exit is not being called if I make the user to input the data.  Based on the empirical evidence, I felt that user input and customer exit can not co-exist!!  Please somebody prove me wrong and let me know how can I use the user input to process my "customer-exit" variable.  I would really appreciate any input from the BW community here.

    Hi Sameer,
    Most likely, I'm missing something, but I think that the answer is very simple.
    CASE I_VNAM.
    WHEN 'YOUR_CUSTOMER_EXIT_VAR'.
    IF I_STEP = 2. “ After selecting of input variable
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'USER_INPUT_VAR'.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = LOC_VAR_RANGE-LOW(4).
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDLOOP.
    ENDIF.
    ENDCASE.
    In this typical user exit coding you have a user entered value in LOC_VAR_RANGE (originally in I_T_VAR_RANGE) and you construct your user exit variable value in E_T_RANGE.
    Best regards,
    Eugene
    Message was edited by: Eugene Khusainov

  • How to accept user inputs from  sql script

    I want to create Tablespace useing sql script , but the location of the data file I need accept from user . (to get the location of the data file ) .
    How can I accept user input from pl/sql .
    Example :
      CREATE TABLESPACE  TSPACE_INDIA LOGGING
         DATAFILE 'H:\ORACLE_DATA\FRSDB\TSPACE_INDI_D1_01.dbf'
         SIZE 500M  AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED
         EXTENT MANAGEMENT LOCAL;here I need to accept location of the datafile from user ie : 'H:\ORACLE_DATA\FRSDB\TSPACE_INDI_D1_01.dbf'

    Hi,
    Whenenever you write dynamic SQL, put the SQL text into a variable. During development, display the variable instead of executing it. If it looks okay, then you can try executing it in addition to displaying it. When you're finished testing, then you can comment out or delete the display.
    For example:
    SET     SERVEROUTPUT     ON
    DECLARE
        flocation     VARCHAR2 (300);
        sql_txt     VARCHAR2 (1000);
    BEGIN
        SELECT  '&Enter_The_Path'
        INTO    flocation
        FROM    dual;
        sql_txt :=  'CREATE TABLESPACE SRC_TSPACE_INDIA LOGGING
         DATAFILE' || flocation || ' "\SRC_TSPACE_INDI_D1_01.dbf" ' || '
         SIZE 500M  AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED
         EXTENT MANAGEMENT LOCAL ';
        dbms_output.put_line (sql_txt || ' = sql_txt');
    --  EXECUTE IMMEDIATE sql_txt;
    END;
    /When you run it, you'll see something like this:
    Enter value for enter_the_path: c:\d\fubar
    old   5:     SELECT  '&Enter_The_Path'
    new   5:     SELECT  'c:\d\fubar'
    CREATE TABLESPACE SRC_TSPACE_INDIA LOGGING
         DATAFILEc:\d\fubar
    "\SRC_TSPACE_INDI_D1_01.dbf"
         SIZE 500M  AUTOEXTEND ON NEXT  1280K MAXSIZE
    UNLIMITED
         EXTENT MANAGEMENT LOCAL  = sql_txt
    PL/SQL procedure successfully completed.This makes it easy to see that you're missing a space after the keyword DATAFILE. There are other errrors, too. For example, the path name has to be inside the quotes with the file name, without a line-feed between them, and the quotes should be single-quotes, not double-quotes.
    Is there some reason why you're using PL/SQL? In SQL, you can just say:
    CREATE TABLESPACE SRC_TSPACE_INDIA LOGGING
    DATAFILE  '&Enter_The_Path\SRC_TSPACE_INDI_D1_01.dbf'
    SIZE 500M  AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL;though I would use an ACCEPT command to given a better prompt.
    Given that you want to use PL/SQL, you could assign the value above to sql_txt. If you need a separate PL/SQL variable for flocation, then you can assign it without using dual, for example:
    DECLARE
        flocation     VARCHAR2 (300)     := '&Enter_The_Path';The dual table isn't needed very much in PL/SQL.
    Edited by: Frank Kulash on Jan 10, 2013 6:56 AM

  • How to validate users with Novell Directory Server

    Hi all, with iAS 6.0 SP3, how i can validate users stored in Novell
    Directory Sever?
    Thanks

    Hi
    I believe iAS is designed to work with iDS which is bundled along
    with the SP3 download. Also the directory server which is working with
    iAS must be Nortel LDAP Schema compatible and I'm not sure if NDS(Novell
    Directory Server) is compatible. What I'm trying to understand is if you
    have already registered iAS with NDS and you are having trouble in
    accessing the users or if you are having trouble in the installation.
    Raj
    Josep Maria Camps Riba wrote:
    Hi all, with iAS 6.0 SP3, how i can validate users stored in Novell
    Directory Sever?
    Thanks

  • How to validate the input field

    Hi,
    I have a input form which is draged from input port of a RFC.
    in this input form i have two input fields nad submit button.
    on of this input field should always take the character values only. it should not take any numeric value
    and other input field should always take numeric value only.
    i.e how to validate this two input fields.
    regards
    srinivas

    Hi,
    U can validate input fields using javascript.Write OnClientClick function for that submit button if ur using htmlb or onClick if u r using html.Refer the follows
    http://help.sap.com/saphelp_nw70/helpdata/en/03/900e41a346ef6fe10000000a1550b0/frameset.htm
    There are two ways to achieve ur task.
    1.By checking for all alphabets.in this u need check all the alphabetic characters one by one.Refer the following
    http://www.shiningstar.net/articles/articles/javascript/javascriptvalidations.asp?ID=ROLLA
    http://www.shiningstar.net/articles/articles/javascript/checkNumeric.asp?ID=AW
    2.By using regular expressions.its very easy and a single line code.here u need to specify single expression for whole alphabets.Refer this
    http://aspzone.com/blogs/john/articles/173.aspx
    Everything has been given for validating in javascript.i hope u also validating in javascript only.
    For more details on "Regular expressions" search google.
    Regards,
    Tamil K

  • How to give user input in flsh animation??

    i m a student of engineering and my project is to create animation of dc motors whose parameters can be controlled by user input
    means current,voltage and speed of the rotor...how con i do it...
    m totally new iin this field and learning flash...
    and can i make these type of animation in flash professional CS5???

    What you should probably consider is using Slider components to control each of the parameters.  There should be examples of how to use them in the help documentation.

Maybe you are looking for