How to check users inputs

hi,there
i am developing an on-line shop,at the end of checking out process , the users are supposed to submit a details form which including first name ,surname, address,email, phone no, card number etc. Can any one tell me how to check those details are valid before sending to database by using javabean or taglib.
any information is helpful , thanks in advance.

You have three choices:
(1) Client-side checking using JavaScript,
(2) Server-side checking using JavaBeans,
(3) Both.
You can check on the client side using JavaScript to make sure that e-mail address formats are valid, numbers are numbers, strings are the right length and format, dates are correct for the locale, etc. You might want to look at the JSTL I18N capabilities here to make sure your pages can handle different locales. This saves you a network roundtrip if something is formatted incorrectly.
The server-side checking is different: it makes sure that the input satisfies business rules. You can check for correct format again if you wish, OR assume that the client has already taken care of this. (Depends on how paranoid you want to be.) The business rules for correctness belong on the server side, not in the client.
I'd recommend both. They really are two different kinds of checks.
MOD

Similar Messages

  • How to use Pl/sql block to edit check user input

    Hi,
    Please advise on PL/SQL Block code that could be used to Check User input from within a Loop and proceed conditionally based upon User Supplied compliant Input. Thanks in advance.

    Hi,
    yakub21 wrote:
    You could use the ACCEPT to get user input and then assign the input to a variable that could then be verified.
    I believe that anything is possible because we don't yet have proof that it is not!
    I do have code that can accept user input. Is it PL/SQL code? Sybrand was clearly talking about PL/SQL:
    sybrand_b wrote:
    Pl/sql is for server side code, it is not a front end tool, and it is incapable of the functionality you describe.If you do have PL/SQL code that accepts user input, please post an example. A lot of people, including me, would be very interested.
    Pass the user-input value to a variable and then assign that value to another variable from within a Declare of a PL/SQL Block.
    The opportunity here is to figure a way to loop with user input until desired input is entered by the user before proceeding with the code. I'm using PL/SQL Block because I don't want the code to persist. I just want to run it as part of database configuration procedure. ThanksIt sounds like you're talking about SQL*Plus, which is a very poor tool for looping or branching.
    It's possible, but it's not pretty. The following thread shows one way of looping in SQL*Plus:
    Re: How to give the different values to runtime parameters in a loop?

  • 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 check current input/output rate on router subintenterface via SNMP?

    How to check current input/output rate on router (2821, etc..) subintenterface via SNMP, like cacti monitoring system.
    I cant find OID to make this with snmpwalk.
    Or there is no way to check current load by this way? Only polling?
    P.S. Ethernet subinterface, of course.
    With great respect, S.A.

    Hi,
    Try to use:
    1.3.6.1.4.1.9.2.2.1.1.6 - InBitRate
    1.3.6.1.4.1.9.2.2.1.1.8 - OutBitRate
    1.3.6.1.4.1.9.2.2.1.1.28 - ifDescription

  • 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.

  • How to check user profile service working in sharepoint 2013?

    HI All,
    How to check user profile service working or not in sharepoint 2013? Thanks.

    Hi,
    Select which OU's you want to synchronize, then check if all users in those OU's have a user profile in the user profile service application.
    Nico Martens - MCTS, MCITP
    SharePoint 2010 Infrastructure Consultant / Trainer

  • Check User inputs ( sap.m.input / sap.m.inputType )

    Hi there,
    I'm trying to check user inputs using sap.m.inputs.
    I want my inputs' state to be changed when their value breaks a constraint.
    For example :
    <input type="Number" .../> => Value is "Azerty" => Error, control's valueStat = Error, the inputs becomes red ( as in the example).
    <input type="Number" ... value="{  path:'Id',  type: 'sap.ui.model.type.Integer',  constraints: {  minimum : 0,                                             maximum : 3 }   } /> => Value is "4" => Error
    My view is binded to an odatamodel, and described as below  :
    <core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc"
        xmlns="sap.m" xmlns:form="sap.ui.layout.form" controllerName="fioriform.manufacturerFormPage"
        xmlns:html="http://www.w3.org/1999/xhtml">
        <Page title="Manufacturer" showNavButton="false" navButtonPress="handleNavButtonPress">
            <content>
                <form:Form id="aForm">
                    <form:formContainers>
                        <form:FormContainer>
                            <form:formElements>
                                <form:FormElement>
                                    <form:label>
                                        <Label text="Id" />
                                    </form:label>
                                    <form:fields>
                                        <Input id="inputId" type="Number" placeholder="Enter an id" maxDigit="2"
                                            valueStateText="Maximum 3 digits."
                                            value="{
                                                path:'Id',
                                                type: 'sap.ui.model.type.Integer',
                                                constraints: {
                                                    minimum : 0,
                                                    maximum : 3
                                                }" />
                                    </form:fields>
                                </form:FormElement>
                                <form:FormElement>
                                    <form:label>
                                        <Label text="Name" />
                                    </form:label>
                                    <form:fields>
                                    <Input id="testMail" type="Email" valueStateText="Fail." />
                                    <Input id="nameInput"
                                     type="Text"
                                     placeholder="Enter Name ..."
                                     valueStateText="Name must not be empty. Maximum 10 characters."
                                     value="{
                                         path:'',
                                         type:'sap.ui.model.type.String',
                                         constraints : {
                                             minLength: 1,
                                             maxLength: 10
                                         }"/>
                                        <Input id="inputName" type="Text" placeholder="Enter a manufacturer name"
                                        valueStateText="Name must not be empty. Maximum 10 characters."
                                            value="{
                                                 path : 'Name',
                                                  type: 'sap.ui.model.type.String',
                                                   contraints:'{minLength:1 , maxLength:10}'
                                            />
                                    </form:fields>
                                </form:FormElement>
                                <form:FormElement>
                                    <form:label>
                                        <Label text="Street" />
                                    </form:label>
                                    <form:fields>
                                        <Input id="inputStreet" type="Text" placeholder="Enter the street"
                                            value="{Address/Street}" />
                                    </form:fields>
                                </form:FormElement>
                                <form:FormElement>
                                    <form:label>
                                        <Label text="City / Zipcode" />
                                    </form:label>
                                    <form:fields>
                                        <Input id="inputCity" type="Text" placeholder="Enter city"
                                            value="{Address/City}" />
                                        <Input id="inputZipCode" type="Text" placeholder="Enter zipcode"
                                            maxLength="6" value="{Address/ZipCode}" />
                                    </form:fields>
                                </form:FormElement>
                                <form:FormElement>
                                    <Button text="Save" press="handleSave" />
                                </form:FormElement>
                            </form:formElements>
                        </form:FormContainer>
                    </form:formContainers>
                    <form:title>
                        <core:Title text="Manufacturer edit" />
                    </form:title>
                    <form:layout>
                        <form:ResponsiveGridLayout />
                    </form:layout>
                </form:Form>
            </content>
        </Page>
    </core:View>
    I have already checked : sap.m Explored  - Checked  and sap.m Explored Types.
    I have tried to attach some functions to the core as : sap.ui.getCore().attachValidationSuccess, sap.ui.getCore().attachParseError, sap.ui.getCore().attachValidationError but without being successful ( no one is called ).
    I have also tried to call a function onChange ( <Input ... change="myFunction"/> ) but i need to rewrite what UI5 seems to check and do alone.
    None of my inputs works except Email even if its behavior it's strange. It becomes red when an email is not well entered, but the displayed text is not "Fail", it is the standard message.
    I do not understand those mechanics. Can someone explain it to me?
    Thanks for Helping,
    Regards,
    Marc

    i will try this then i come back yo you.
    Thanks,
    Regards,
    Marc
    edit: it works but like i said before, i do not want to rewrite what UI5 seems to do alone - when specifiing types and values -.
    I would like somebody to help me out in my ignorance here.
    Message was edited by: Marc BROSSAIS

  • 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

  • Check user input

    Have this small script (my first attempt in Scripting), which is loaded with Acrobat 9 at startup.
    app.addMenuItem({ cName: "Gem &KMS-skrivelse", cParent: "File", cExec: "SaveAs('registreringsmeddelelse', 'produkter/')", nPos: 3 });
    app.addMenuItem({ cName: "Gem &dokument i sag", cParent: "File", cExec: "SaveAs('', '')", nPos: 4 });
    function SaveAs(cName, cDirectory)
        //Get full year
        var date=new Date();
        cYear = date.getFullYear();
        //Get year, case number and file name from user input
        var cYear = app.response({ cQuestion: "Indtast sagsår:", cTitle: "Sagsår", cDefault: cYear });
        var cCase = app.response({ cQuestion: "Indtast sagsnr.:", cTitle: "Sagsnr."});
        var cFile = app.response({ cQuestion: "Indtast filnavn (uden .pdf):", cTitle: "Filnavn", cDefault: cName });
        if (cFile == null)
             return;
        //Concatenate path string
        var cPath = "/h/digi/s" + cYear + "/" + cYear + "-" + cCase + "/" + cDirectory + cFile + ".pdf";
        //Try to save the document, if success, inform the user where to
        try {
            this.saveAs({ cPath: cPath, bPromptToOverwrite: true });
            app.alert("Dokumentet blev gemt i " + cPath, 3);
        catch(e) {
            app.alert("Kunne ikke gemme dokument i " + cPath + ". Kontroller at mappen er oprettet, og at du har skriverettigheder til denne, samt at Acrobat/Reader er sat korrekt op.");
        //So long and thanks for all the fish
        return;
    Based on user input it saves documents to folders on a network share.
    It  works just fine, but if the user cancel the input dialog, null is  returned, and eventually will be part of the filename. So I use a if  statement to check if cFile is null, and if true just returns the  function. But this fails with this error message:
    GeneralError: Handlingen mislykkedes.
    Root.(null):17:Menu Gem &dokument i sag:Exec
    script terminated
    Why is this so?
    Best regards
    mp

    The script still continues after return;
    Try this
    app.addMenuItem({ cName: "Gem &KMS-skrivelse", cParent: "File", cExec: "SaveAs('registreringsmeddelelse', 'produkter/')", nPos: 3 });
    app.addMenuItem({ cName: "Gem &dokument i sag", cParent: "File", cExec: "SaveAs('', '')", nPos: 4 });
    function SaveAs(cName, cDirectory)
        //Get full year
        var date=new Date();
        cYear = date.getFullYear();
        //Get year, case number and file name from user input
        var cYear = app.response({ cQuestion: "Indtast sagsår:", cTitle: "Sagsår", cDefault: cYear });
        var cCase = app.response({ cQuestion: "Indtast sagsnr.:", cTitle: "Sagsnr."});
        var cFile = app.response({ cQuestion: "Indtast filnavn (uden .pdf):", cTitle: "Filnavn", cDefault: cName });
       if (cFile == null)
    else
        //Concatenate path string
        var cPath = "/h/digi/s" + cYear + "/" + cYear + "-" + cCase + "/" + cDirectory + cFile + ".pdf";
        //Try to save the document, if success, inform the user where to
        try {
            this.saveAs({ cPath: cPath, bPromptToOverwrite: true });
            app.alert("Dokumentet blev gemt i " + cPath, 3);
        catch(e) {
            app.alert("Kunne ikke gemme dokument i " + cPath + ". Kontroller at mappen er oprettet, og at du har skriverettigheder til denne, samt at Acrobat/Reader er sat korrekt op.");
        //So long and thanks for all the fish
        return;

  • 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 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.

  • How to save User input into DB using webdynpro abap

    Hi,
    Im trying to create an application using webdynpro abap.
    I want to know how to save the data input by user, into a database table.
    In my UI, I have a table control which is editable and user inputs data into this. I need to know how i can transfer this data to a DB table.

    hello,
    u can do it by reading ur context node.
    we bind our UI elements to context attributes of appropriate type .
    we read their values using the code wizard or by pressing control+F7, click on radio button read node/attribute
    here for ur specific case , u must have binded ur table control with the context attribute , now u need to simply read this attribute
    eg suppose u have created a context node " cn_table"
      reading context node cn_table
       DATA : lo_nd_cn_table TYPE REF TO if_wd_context_node ,
             lo_el_cn_table TYPE REF TO if_wd_context_element ,
             ls_cn_table    TYPE wd_this->element_cn_table.
    *   navigate from <CONTEXT> to <CN_TABLE> via lead selection
      lo_nd_cn_table = wd_context->get_child_node(
                       name = wd_this->wdctx_cn_table ).
    **    get element via lead selection
      lo_el_cn_table = lo_nd_cn_table->get_lead_selection(  ).
      lo_el_cn_table->get_static_attributes( IMPORTING
                 static_attributes = wa_table ).
    here wa_table is the work area of structure type . u need to create a structure first with the same variables as there are the context attributes in ur node cn_table
    in ur
    now ur wa_tablecontains value
    u can nw use appropriate FM to update , delete and modify the DB table using the value
    u cn directly use SQL statements as well in the method of ur view , but direct SQL statements are nt recommende
    rgds,
    amit

  • How to control user input with a button?

    How do I control a user input from a dialog box by activating it with a button. I am saying "press zero", then when the user does press zero, it should zero the scale.

    The user has only one button they can press.  You should enable the cancel so that the dialog can output an F.  
    What you have works, but the zero will not occur until the case is activated.  If the insides of the case do not work, that is another story.  Put a pop up in the active case to convince yourself that the case is being entered.
    This, what you have, always returns T.
    Mark Ramsdale

  • How to specify user input?

    I know how to use the Keyboard class to prompt user input, but if I want to create custom user arrays, can anyone help me go about how to do it?
    I want the user to be able to specify an array between 100 and 200 characters ins ize, and I'd create an array like that according to the user input...I don't have a clue how I'd even begin this though...Please help.

    If I understand correctly: take user input as an int and create an array of that size? if so:
    int size = parseInt( args[0] );
    ObjectName nameOfArray[] = new ObjectName[size];
    args is (almost) always a string array so you need to extract the int value (parse it). that simple :)

Maybe you are looking for

  • Price problem while making budget PO for a Project

    Dear Friends, I wanted help from all you guys, this is related to budgetting in PS, the PS consultant prepares PR for a material wrt to a project , he has set a budget of say Rs 10000 to procure this material, now I use this PR to make a PO , & the n

  • Can Not Print Document -- Prints in Foxit

    I have several Acrobat documents that were e-mailed to me.  Most of them have no problems printing, but those with signatures will Not print in Acrobat Reader XI or Acrobat Pro 9.  Trying to print to a local printer, network printer, or PDF all resul

  • Trasanction Codes used in Sales & Marketing Modules

    Hi All, Please provide important Transaction  codes (T Codes) that is been using in Sales & Marketing modules for solving the Support It Ticket for CRM. Please let me know which are the area's that are using into. eg: Sa38 is ABAP reporting       Sm3

  • Can not execute 'asset year change' successfully.

    Hi all, I started run asset accounting sub-module of ECC 6.0 in 2007. After I posted depreciation on all of periods of fiscal year 2008. I change asset fiscal year to 2009 by 3 steps: First, I checked all of periods from fiscal year 2007 to fiscal ye

  • Which user has which forms open?

    is it possible to find out which forms currently are open by which OS-user? i'm looking for informations like in v$session view. here i see who is connected to a certain instance and how (ifweb90.exe,rwbuilder.exe). i don't need to populate this info