Validate the user input against HTML tags

There is text field in my form, the user inputs in this field should be validated against HTML tags. like:
<H1>HAI</H1> ,
and "<script>alert('Hai')</script>"
it should say pls validate a text without HTML tags.
Pls let me how can I achieve this?
Regars,
Nagalakshmi

You have to spilt the text in the form field, identifiy the difference between the text and HTML tags. The available options are ucan use String.lastIndex("<") methos apply some logic to find the same
baiju

Similar Messages

  • How to validate a user input for where clause?

    I have a situation to validate a where clause which is input by the user.
    Because the query will be run against huge tables and we need to notify the user if they input the clause is not valid.
    I use the below query to try:
    Select 'A' from blablabla where user_input_where_clause and 1=0;
    however, it can not capture the error when the user input:
    'name=123' while the right condition should be name='123'.
    Can you pls advise ?

    In this particular case, Oracle will not even try to run the SQL statement because of the syntax error. IF the WHERE condition supplied does not make sense, Oracle will not execute the statement, so it does not matter if the query accesses huge tables.
    SQL> Select 'A' from blablabla where 'name=123' and 1=0 ;
    Select 'A' from blablabla where 'name=123' and 1=0
    ERROR at line 1:
    ORA-00920: invalid relational operator
    SQL>IF you have a restriction as to what type/value can user specify for the where condition (asuming it would make sense to SQL engine), you would have to do it before submitting to the database.
    Note, however, that user could specify any condition they like, having potentially damaging effects.

  • How to validate the values inputted in Salestext view at MM02 before saving

    Hello All,
    Does anyone know what FM or user exit to use in order to validate the values inputted in Salestext view at MM02 transaction before saving it.
    Regards,
    Alfred

    Hello,
    Find the user exits if any after finding keep the break point in the exits and check that cursor is trigrring that exit or not. If it triggers check the value of the salestext exits in the exporting parameters or not.
    if exits then keep do the validations.
    UserExits MM02
    MGA00001            Material Master (Industry): Checks and Enhancements
    MGA00002            Material Master (Industry): Number Assignment
    MGA00003            Material Master (Industry and Retail): Number Display

  • How to Validate the user entred value

    Hi All
    I am new to APEX... :)
    Can any one send me the URL or material where i can go through and create sample applicaiton having the following functionalities
    1) Create a form for the user to enter the data
    2) Create users and give access
    3) Validate the user entered values (Validation of a e-mail filed or Phone no)
    Thanks & Regards
    Hari

    Hari,
    You should start on our Getting Started page (http://www.oracle.com/technology/products/database/application_express/html/getting_started.html). I would suggest you do the OBE. It will show you how to create an application, add validations (that is what will make a user enter data in your email and phone fields) and create users. It uses APEX Authentication which means that any developer within the workspace can access and run the application and that you can also create end-users from within your workspace that will only be able to run your applications (not access the development environment).
    It will definitely answer your questions -
    -- Sharon

  • How to restrict the user input textfield to an Integer?

    Hello there;
    Here is my problem, and i need your help.
    I have a mssql 2005 server as my back end database;
    I have designed a web application from which i can load a specific table in my database.
    One of my table column is of integer type and i want to restrict the user to only entered an integer in the textfield.
    I have try the integer converter from the "converters" section of the pallete. The result is that its actually restrict the user input to be an integer, but i can't load the database, obtaining a java.lang.Int error message.
    Next i have tried using int theid=int.parseInt........ but i am receiving a syntax error of the type cannot find symbol parseInt.
    I can't just work this out!
    Could anybody help please.

    As has been stated in previous replies you can check that the value in the TextField is parseable as an Integer by using Integer.parseInt(fieldVariable.getText()). However, you can also restrict what characters can be entered into the text field, like so:
    Assume your field variable is textField1 then the KeyTyped event for the text field:
    private void textField1KeyTyped(java.awt.event.KeyEvent evt) {
         if (evt.getKeyChar() < '0' || evt.getKeyChar() > '9') {
              evt.consume();
    }will only allow the numeric characters (i.e., 0-9) to be typed into the field. Keep in mind that in this case the backspace, delete, home, arrow, etc, keys will not delete characters, move the cursor, etc, so if you want those you have to test for them as well.

  • How to get the User input of Dynamic Action confirmation message ?

    Hi Guys,
    I'm using apex 4.1,
    I have added a confirmation message box as page Dynamic Action. How can i get the user input of that confirmation pop up ?
    Thanks

    Hi,
    you don't directly get the user input. But you should still be able to get what you want. Let's assume you have a dynamic action which fires for a "Change" (or any other) event and which has two or more actions
    1) Confirm
    2) Execute PL/SQL Code
    If the user clicks Cancel/No in the confirm dialog, APEX will stop the execution of this dynamic action and not run "Execute PL/SQL Code".
    Hope that helps
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Add a actionlistener to JTextArea and print out string when  the user input

    Hello:
    I got a problem to add a actionlistener to JTextArea and print out string which from the user input a sentence and after the user press the "enter".
    Could anyone help me please?
    Thanks
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.JScrollBar;
    public class PanelDemo extends JFrame {
       private static JTextArea tAreaUp, tAreaDown;
       private BorderLayout layout;
       private static String strings;
       public PanelDemo()
          super( " test " );
          Container container = getContentPane();
          layout = new BorderLayout();
          container.setLayout( layout );
          tAreaUp = new JTextArea(2,1);
          tAreaUp.setLineWrap(true);
          tAreaUp.setWrapStyleWord(true);
          tAreaUp.setEditable(false);
          tAreaUp.append("I am testing ");
          tAreaUp.append("I am testing");
           JScrollPane scrollPane = new JScrollPane(tAreaUp);
           scrollPane.setVerticalScrollBarPolicy(
                            JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
           scrollPane.setPreferredSize(new Dimension(250, 250));
          tAreaDown =new JTextArea(2,1);
          tAreaDown.setLineWrap(true);
          tAreaDown.setWrapStyleWord(true);
          tAreaDown.addActionListener(new TextAreaHandler());
          JScrollPane scrollPane2 = new JScrollPane(tAreaDown);
          scrollPane2.setVerticalScrollBarPolicy(
                            JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
          container.add( scrollPane, layout.CENTER );
          container.add( scrollPane2, layout.SOUTH );
          setSize( 300, 300 );
          setVisible( true );
         //private inner class for event handling
         private class TextAreaHandler implements ActionListener{
              //process textArea events
            public void actionPerformed(ActionEvent e){
               strings=e.getActionCommand();
                System.out.println(strings);
       public static void main( String args[] )
          PanelDemo application = new PanelDemo();
          application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    }

    Thanks for your help, but I still got a question for you.
    Do you think the way I register the even handler to the TextArea is correct?
    Because the compailer complains about that which like
    "D:\101\fig13_27\PanelDemo.java:43: cannot resolve symbol
    symbol  : method addActionListener (PanelDemo.TextAreaHandler)
    location: class javax.swing.JTextArea
          tAreaDown.addActionListener(new TextAreaHandler());

  • How can I have the user input two things to get result

    Hi
    I am trying to produce an interactive slide where the user will input two items and then receive the result.
    The easiest way to describe what I am hoping to do is..........
    Imagine the multipllication table and the user has to input what he wants to mulitiply ie 3 in the first text entry box and 5 in the next presses the button and the result is shown.
    Now imagine the table isn't a mathematical table but a series of words across the x and y axis. The user inputs Word A, Word B and presses submit and the answer (another word) depending on the two inputs appears. There would be 12 x12 table so 144 different combinations.
    Is this possible in Captivate 7?
    thanks
    Ruth

    HI
    There is little relationship between the two, this isn't actually the table but the same principle and shows what I am trying to acheive.
    cookies
    muffins
    cupcakes
    chicken roast
    crispies
    gas mark 1
    great idea
    gas mark 2
    great idea
    flapjacks
    gas mark 2
    gas mark 3
    350 C
    450F
    roast potatoes
    impossible
    great idea
    gas mark 3
    450F
    parsnips
    great idea
    350 C
    gas mark 3
    impossible
    thanks
    Ruth

  • Is there any way in FDQM to validate the source records against the essbase

    hi everyone
    i want to know is there any way that FDQM can validate the source records against essbase. say for example i have a a ud dimension member coming from the source i want to compare this member with essbase member in the outline and pass/fail the validation. can we do this?
    thanks
    tm

    Hi
    Are you processing through the web client or as a batch process?
    If you are loading manually through the web then it is standard functionality to highlight any source metadata imported that does not get mapped to a target, you then get the opportunity to correct those members at the Validate stage. If you are setting up mapping tables with specific target members then these have to be valid members in the Essbase outline (although I guess there is a risk that those members change over time and do you mappings stay in sync), it also doesn't do that validation if you upload your maps from template files (.xls / .tra / .trn) or if you have a * to * like mapping.
    If you are processing in batch then if there are any members that do not have a vliad target member after import (remember mapping is applied during the import stage) then the batch fails. You can use the AutoMapCorrect feature to overcome this and map to a default 'suspense' type member if that gives you an issue.
    Ultimately if you get to the load stage and the combination of members is not valid then FDM produces a load error file, this will contain all of the records exported from FDM that have failed to load to Essbase. What this doesn't easily give you is the source metadata that makes up those failed records.
    Can you provide any more info as to your current process and then we might be able to provide a few more pointers.
    Hope this helps
    Stuart

  • How i can show the user input in alv list on the top

    hi all,
                   please tell me how i can show the user input in alv list on the top.
                         and  also tell me how i  can hide the toolbar in alv.
    regards
    vikas saini

    Hi,
    Use the Below Code.
    form top_of_page.                                          
      data : it_header type slis_t_listheader,
             is_header type slis_listheader.
      is_header-typ  = c_h.
      is_header-key  = space.
      is_header-info = 'Pending Order Information Report'(018).
      append is_header to it_header.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
        exporting
          it_list_commentary = it_header.
    endform.                    "top_of_page
    and finally pass it to .
    call function 'REUSE_ALV_GRID_DISPLAY'
          exporting
            i_callback_program     = sy-repid
            i_callback_top_of_page = 'TOP_OF_PAGE'
    call function 'REUSE_ALV_GRID_DISPLAY'
          exporting
            i_callback_program     = sy-repid
            i_callback_top_of_page = 'TOP_OF_PAGE'
    Regards.
    Arbind

  • How to generate the User-Input XML Body for executing workflows via REST APIs: The Solution

    I see that executing a workflow via REST APIs requires lot of work to be done just to prepare the right User-input XML body. Any mistake and you have some major debugging to do. Larger the number of User-Inputs, the bigger is the problem.Life is so much easier at the WFA GUI with Display names and tooltip help for User Inputs which are very easy for reading and providing the right values. I don't have any such privileges when manually preparing the User-Input XML body.It’s been asked numerous times how to provide User-Input values for type table, or Query (Multi-Select) etc. These are complex User-Input types and has lots of scope for user mistakes.I can have User-input dependency at WFA GUI which allows me to make the right selection, but while preparing my XML body I need to take care of it myself.An operator is allowed to execute workflows, but the same Display names which help him make the right user-inputs, makes it impossible for him to prepare the user-input body xml. Display names can't be used in in XML body and he can't know the exact parameter names by looking at the Display names. So he need to always contact the Admins/Architects for this. And Architects/Admins can't be expected to keep providing User-Input XML body to operators every operator. How about if I could enter all the User-Input values in my workflow execution at WFA GUI, I can do a preview which passed to my satisfaction and then I can magically get the XML body for it which I can use to execute my workflow from REST APIs from any client. It could be so very much easy for me than building my User-Input XML body manually. This is exactly what I'm going to give you right now. You open the WFA in browser, Go to your workflow, Start execution, you input values from GUI reading carefully the display names, preview it to your satisfaction and then get the XML body. Assume your workflow is called “Workflow to Print a given Message”. It’s a simple workflow with only 1 user-input Displayed as "Message to Print" Prerequisites:  The following are the one-time prerequisites. You need PowerShell 3.0 on your WFA server.Import the attached Generate_Workflow_User_Input_Body_in_XML.dar in your WFA. It’s our magical command called "Generate Workflow User Input Body in XML"Add credentials of a WFA Admin/Architect in you WFA itself with Name/IP: localhostMatch: ExactType: OtherName/IP: localhostUsername: <WFA Admin/Architect Username>Password: <User Password>   Steps: Suppose you have a workflow called "Workflow to Print a given Message". You want to execute it from REST apis and need to prepare the user input XML body.  Select this workflow and clone it. The workflow clone is the exact copy of your original workflow word by word, input-by-input. It will open in Edit mode with name "Workflow to Print a given Message - copy".Add the command "Generate Workflow User Input Body in XML" at the beginning of your workflow. This is a must. This command need to be the first command in your cloned workflow.This command requires no input. So for its Parameters just press okay and save the workflow.You are done.Now Execute the clone workflow. You'll see all the user-inputs available to you. Make your choices as you wish. Preview it to confirm that planning is passed and u have no errors.Execute it now.You'll see that the our magical command "Generate Workflow User Input Body in XML" has failed in our clone workflow execution. Don't worry, its fate was decided to be so. But it didn't fail before giving me what I really wanted. i.e. my XML body for my real workflow. It displayed it in the GUI as well as saved it in your WFA server @ C:\temp\<workflow_name_dd_MM_yyyy_hh_mm_ss_.xmlIt also deleted all the reservations of this particular failed job. So NO major residue left to be cleaned.To summarize: Clone Your workflow and Add the command "Generate Workflow User Input Body in XML" as your first command.    Start Execution, provide your User-inputs and preview it. Be satisfied and Press Okay.   Now Execute it.  After a few scconds this cloned workflow will fail with Error "All done. The Workflow will fail now."     See the command execution logs for this command. You'll see the User-Input XML body. It has also saved the XML file at C:\temp in your WFA server.   Have fun. sinhaa  

    Providing a new version 1.1.0 of the command "WFA Schedular" Changes made: Added conditional String Representation based on the Scheduling parameter provided. Provided check for the right number of parameters passed into the command.Added a new parameter "Expiry Date" to automatically stop the recurring execution upon expiry.Check for Posh3.0 version in code.Have Fun!! sinhaa Below example for:Schedule a workflow for recurring execution every alternate day i.e. once in 2 days at 10:30 PM starting 06-Jul-2015 (Today's date is 02-Jul-2015) . The recurring workflow execution  should expire on 31-Dec-2015 and stop.  

  • I    have a new name and I can not verify my account.  How do I validate the user name?

    I have a new name and I can not verify my account.
    How do I validate the user name?

    Hello lirom12,
    Check out the article below to get your Apple ID verified so you can use it. You would need to send an email to get it verified. 
    If you didn't receive your Apple ID verification or reset email
    http://support.apple.com/kb/TS5404
    Regards,
    -Norm G. 

  • How to retrieve the user input in One Step Screenflow

    Hello all,
    I am new in KM. I would like to ask in One Step Screenflow, I have add a inputfield into the ConfirmComponent. How can I retrieve the user input?
    public IRenderingEvent execute(IScreenflowData sfd) throws WcmException
              inp.setLabel(new Label("Delegation:"));
              ConfirmComponent cc = new  ConfirmComponent(ConfirmComponent.OK_CANCEL,this.context.getLocale(),inp);
              String sRid = (String)this.values.get(0);
              RID rid = RID.getRID(sRid, null);
              OneStepScreenflow oscf = new OneStepScreenflow(sfd,this.getAlias(),rid,cc);
              return oscf.execute();
    In the IRenderingEvent , How to retrieve the user input?
    public IRenderingEvent execute(IResource res, Event event ) throws WcmException
              if (event instanceof ConfirmEvent)
                        ConfirmEvent cce = (ConfirmEvent)event;
                        if (ConfirmEvent.CHOICE_YES.equals(cce.getChoice()))
                                  return new InfoEvent(Status.OK, "Done !");
                        else if (ConfirmEvent.CHOICE_NO.equals(cce.getChoice()))
                                  return ConfirmComponent.onNo(event, res.getContext().getLocale());
                        else if (ConfirmEvent.CHOICE_CANCEL.equals(cce.getChoice()))
                                  return ConfirmComponent.onCancel(event, res.getContext().getLocale());
              return new InfoEvent(Status.ABORT, "Aborted.");
    Many Thanks,
    Sunny

    Hello yoga,
    Many Many thanks for your reply again.
    I have just try the class in the thread link.
    There is a error
    "The project was not built since its classpath is incomplete. Cannot find the class file for javax.servlet.http.HttpServletRequest. Fix the classpath then try rebuilding this project."
    The errors occurs because of "extends OneStepComponent"
    public final class NewConfirmInputComponent extends OneStepComponent
    Where can find javax.servlet.http.HttpServletRequest to include it in my classpath?
    Thanks
    Sunny

  • Quiz Results - Showing the users input

    Could you tell me if there is away to display or print the users input to the questions slides on to one page.
    My Learners take an assessment on their induction course.  Using Trainersoft I can display one page  showing their answers to the questions.  I then print this off and we go through it to see where their strengths and weaknesses are.  I cant seem to do this with Captivate 4.
    I know about review quiz option (one page at a time) but when you have a classroom of up to 16 people it isn't practical.
    Thank you in advance

    Hi,
    Although this may not be an easy one to accomplish in CP4, but still you can use Variables and Scripting to store and display the user responses on a slide.
    Whenever a student answers some question, you can store some strings w.r.t the response, in a user variable (created by you) and then display it using a text caption on a slide. In this way, you can always show the response of the student with a custom message also.
    This will become more easy with the new features of CP5.
    http://www.adobe.com/products/captivate/features/?view=topnew
    Regards
    Chinmay

  • How would I change the variables in multiple methods with the user input?

    Here is my code for a tic tac toe game I have to do for an assignment, it is currently set at the normal 3 x 3, but the teacher what the user to be albe to change these to between 3-5 before they start playing, here is my codeing
    import java.util.*;
    public class TicTacToe
    Constructs an empty board.
    private String[][] board;
    private static int ROWS = 3;
    private static int COLUMNS = 3;
    public TicTacToe()
    int size = in.nextInt();
    board = new String[ROWS][COLUMNS];
    // Fill with spaces
    for (int i = 0; i < size; i++)
    for (int j = 0; j < size; j++)
    board[i][j] = " ";
    Sets a field in the board. The field must be unoccupied.
    @param i the row index
    @param j the column index
    @param player the player ("x" or "o")
    public void set(int i, int j, String player)
    if (board[i][j].equals(" "))
    board[i][j] = player;
    Creates a string representation of the board, such as
    |x o|
    | x |
    | o|
    @return the string representation
    public String toString()
    String r = "";
    for (int i = 0; i < ROWS; i++)
    r = r + "|";
    for (int j = 0; j < COLUMNS; j++)
    r = r + board[i][j];
    r = r + "|\n";
    return r;
    I am having a problem figuring out how to change the variables ROWS , COLUMNS to the given user input, it seems easy but i can't really figure out how to do it
    thanks ahead of time

    import java.util.*;
    public class TicTacToe
    Constructs an empty board.
    private String[][] board;
    private static int ROWS = 3;
    private static int COLUMNS = 3;
    public TicTacToe()
    int size = in.nextInt();
    board = new String[ROWS][COLUMNS];
    // Fill with spaces
    for (int i = 0; i < size; i++)
    for (int j = 0; j < size; j++)
    board[j] = " ";
    Sets a field in the board. The field must be unoccupied.
    @param i the row index
    @param j the column index
    @param player the player ("x" or "o")
    public void set(int i, int j, String player)
    if (board[j].equals(" "))
    board[j] = player;
    Creates a string representation of the board, such as
    |x o|
    | x |
    | o|
    @return the string representation
    public String toString()
    String r = "";
    for (int i = 0; i < ROWS; i++)
    r = r + "|";
    for (int j = 0; j < COLUMNS; j++)
    r = r + board[j];
    r = r + "|\n";
    return r;
    }sorry for not posting code correctyl new to this forums
    Thanks for the help but let me rephrase my question, the rows and columns are the same like 3x3, 4x4 ,or 5x5,
    -when the program runs it will ask the user for what they want to set the tic tac toe at between 3 - 5.
    My question is how do I get the code
    Scanner a = new Scanner ( System.in );
    System.out.print("Enter the size of the tic tac toe box to be between 3-5 : ");
    int sizeTicTacToe = a.next();to change the variables of ROWS COLUMNS
    I just want to know of a way to make the users input of sizeTicTacToe to change the variables ROWS & COLUMNS in my toString() and TicTacToe() methods

Maybe you are looking for