Text Field with javascript tags execute

We have a form with multiple text fields on it for users to enter information. If a user puts in something like the following:
<script type="text/javascript">window.location="http://www.oracle.com";</script>
into a text field and submits the page, anytime that text field is called on a page, the javascript will execute and redirect the user to oracle.com. Obviously, there needs to be some encoding of all text fields, but I was surprised that this actually worked. What have people done to restrict this from happening? Do we write a PL/SQL process to run onSubmit to check all text fields?
Thanks,
Jon

http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/sec.htm#CHDGEEFC
Tyler Muth
http://tylermuth.wordpress.com
[Applied Oracle Security: Developing Secure Database and Middleware Environments|http://www.amazon.com/gp/product/0071613706?ie=UTF8&tag=tylsblo-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=0071613706]

Similar Messages

  • How do I add and remove text in a text field with a checkbox?

    How do I add and/or remove text in a text field with a checkbox?
    this is my script in the text box......
    event.value="Hello, this is my narrative. \r\n\nFamily: \r\n\n" + this get.Field("FirstName").value + " " + this.getField("LastName").value + was born on"=this.getField("DOB.value + "\r\n\n + this.getField("drpField").value + "\r\n\n" + this getField("Father").value
    The text box looks like this...
    Hello, this is my narrative.
    FAMILY:
    John Smith was born on 08/02/2000
    Boby Lou
    Jack Smith
    I need to add/or remove the father field (Jack Smith) & r/n/n with a check box.
    Does anyone know how to do this?

    There are multiple errors in your code...
    Use this code instead (adjust the name of the check-box):
    var msg = "Hello, this is my narrative. \r\n\nFamily: \r\n\n" + this get.Field("FirstName").value + " " + this.getField("LastName").value + was born on" + this.getField("DOB.value) + "\r\n\n" + this.getField("drpField").value;
    if (this.getField("FatherCheckBox").value!="Off")
         msg += "\r\n\n" + this getField("Father").value;
    event.value = msg;

  • Auto populate text fields with a trigger such as entering text into input fields in ADF

    Hello all,
    I am not able to auto populate text fields with a trigger such as entering text into input fields in ADF.
    I tried AdfFacesContext.getCurrentInstance().addPartialTarget(val); in the back end using setter method of input text field.
    its not working ..
    is there any way to achieve it
    Regards,
    Shakir

    Hi,
    Always mention your JDev version.
    The valueChangeListener would fire only when you set the autoSubmit property of the field to true. Can you elaborate your requirement? What do you mean by related data? Are you performing some sort of search?
    If you want to get the value you entered on the field, just set autoSubmit to true and get the new value from the valueChangeListener. If your requirement is something like as and when you type, do something, you need to check out this approach :https://blogs.oracle.com/groundside/entry/auto_reduce_search_sample
    -Arun

  • How to create Using Formatted Text Field with multiple Sliders?

    Hi i found the Java Sun tutorial at http://java.sun.com/docs/books/tutorial/uiswing/components/slider.html very useful, and it tells how to create one Formatted Text Field with a Slider - however i need to create Formatted Text Field for multiple Sliders in one GUI, how do i do this?
    my code now is as follows, and the way it is now is scroll first slider is okay but scrolling second slider also changes value of text field of first slider! homework due tomorrow, please kindly help!
    // constructor
    label1 = new JLabel( "Individuals" );
    scroller1 = new JSlider( SwingConstants.HORIZONTAL,     0, 100, 10 );
    scroller1.setMajorTickSpacing( 10 );
    scroller1.setMinorTickSpacing( 1 );
    scroller1.setPaintTicks( true );
    scroller1.setPaintLabels( true );
    scroller1.addChangeListener(this);
    java.text.NumberFormat numberFormat = java.text.NumberFormat.getIntegerInstance();
    NumberFormatter formatter = new NumberFormatter(numberFormat);
            formatter.setMinimum(new Integer(0));
            formatter.setMaximum(new Integer(100));
    textField1 = new JFormattedTextField(formatter);
    textField1.setValue(new Integer(10)); //FPS_INIT
    textField1.setColumns(1); //get some space
    textField1.addPropertyChangeListener(this);
    //React when the user presses Enter.
    textField1.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),  "check");
            textField1.getActionMap().put("check", new AbstractAction() {
                public void actionPerformed(ActionEvent e) {
                    if (!textField1.isEditValid()) { //The text is invalid.
                        Toolkit.getDefaultToolkit().beep();
                        textField1.selectAll();
                    } else try {                    //The text is valid,
                        textField1.commitEdit();     //so use it.
                    } catch (java.text.ParseException exc) { }
    label2 = new JLabel( "Precision" );
    scroller2 = new JSlider( SwingConstants.HORIZONTAL, 0, 100, 8 );
    scroller2.setMajorTickSpacing( 10 );
    scroller2.setMinorTickSpacing( 1 );
    scroller2.setPaintTicks( true );
    scroller2.setPaintLabels( true );
    scroller2.addChangeListener(this);
    textField2 = new JFormattedTextField(formatter);
    textField2.setValue(new Integer(10)); //FPS_INIT
    textField2.setColumns(1); //get some space
    textField2.addPropertyChangeListener(this);
    //React when the user presses Enter.
    textField2.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),  "check");
            textField2.getActionMap().put("check", new AbstractAction() {
                public void actionPerformed(ActionEvent e) {
                    if (!textField2.isEditValid()) { //The text is invalid.
                        Toolkit.getDefaultToolkit().beep();
                        textField2.selectAll();
                    } else try {                    //The text is valid,
                        textField2.commitEdit();     //so use it.
                    } catch (java.text.ParseException exc) { }
    // State Changed
         public void stateChanged(ChangeEvent e) {
             JSlider source = (JSlider)e.getSource();
             int fps = (int)source.getValue();
             if (!source.getValueIsAdjusting()) { //done adjusting
                  if(source==scroller1)   {
                       System.out.println("source ==scoller1\n");
                       textField1.setValue(new Integer(fps)); //update ftf value
                  else if(source==scroller2)     {
                       System.out.println("source ==scoller2\n");
                       textField2.setValue(new Integer(fps)); //update ftf value
             } else { //value is adjusting; just set the text
                 if(source==scroller1)     textField1.setText(String.valueOf(fps));
                 else if(source==scroller2)     textField2.setText(String.valueOf(fps));
    // Property Change
        public void propertyChange(PropertyChangeEvent e) {
            if ("value".equals(e.getPropertyName())) {
                Number value = (Number)e.getNewValue();
                if (scroller1 != null && value != null) {
                    scroller1.setValue(value.intValue());
                 else if (scroller2 != null && value != null) {
                    scroller2.setValue(value.intValue());
        // ACTION PERFORMED
        public void actionPerformed(ActionEvent event) {
        if (!textField1.isEditValid()) { //The text is invalid.
            Toolkit.getDefaultToolkit().beep();
            textField1.selectAll();
        } else try {                    //The text is valid,
            textField1.commitEdit();     //so use it.
        } catch (java.text.ParseException exc) { }
             if (!textField2.isEditValid()) { //The text is invalid.
            Toolkit.getDefaultToolkit().beep();
            textField2.selectAll();
        } else try {                    //The text is valid,
            textField2.commitEdit();     //so use it.
        } catch (java.text.ParseException exc) { }
    ...

    if :p3_note_id is null
    then
    insert into notes (project_id, note, notes_month, notes_year) So, p3_note_id is NULL.
    Another option is that you have a trigger on table NOTES that generates a new note_id even for an update.

  • Adding current date to text field w/ Javascript in Acrobat 8

    I am trying to add the current date to a text field using javascript in Acrobat 8 Professional. I am using the util.printd function in a javascript function but the date of creation shows in the text field, NOT today's date. Any clues??
    var f = this.getField("myField");
    if (!f.value) f.value = util.printd ("m/d/yyyy", new Date());

    Thanks. I've used it also without the empty value check and had the same result of showing the creation date and not the current date.

  • Having issues with populating a Text Field with data from 2 other fields

    I have 3 fields Tools_1a_pri, Tools_1a_pri_other, Tools_1a_pri_txt.
    Tools_1a_pri is a drop down combo with a predefined list. One of the options is "Other".  When "Other" is selected, the text field Tools_1a_pri_other becomes visible for users to enter the name of the other tool.
    The Tools_1a_pri_txt is a text field with a calculation that shows either text stating that no tool has been selected or the Tools_1a_pri & or Tools_1a_pri_other.
    When I select one of the predefined tools, everything works.  When I select other, it appears that nothing has changed.  It requires that I click on another field before it populates.  This is confusing to the user.
    Tools_1a_pri   Validate code
    this.getField("Tools_1a_pri_Other").display = event.value=="Other" ? display.visible : display.hidden;
    Tools_1a_pri_txt  Calculation code
    //if nothing is selected, do the following
    if (getField("Tools_1a_pri").value.length < 2) {
    event.target.textColor = color.red
    event.value = "No primary tool identified";
    }else if (getField("Tools_1a_pri").value != "Other") {
    //otherwise do this if other is selected
    event.target.textColor = color.black
    event.value = getField("Tools_1a_pri").value;
    }else if (getField("Tools_1a_pri").value = "Other") {
    //otherwise do this if other is not selected
    event.target.textColor = color.black
    event.value = getField("Tools_1a_pri").value + " - " + getField("Tools_1a_pri_Other").value;

    You made the classic mistake of using the assignment operator in an if-statement instead of the comparison operator. Change this line:
    } else if (getField("Tools_1a_pri").value = "Other") {
    To this:
    } else if (getField("Tools_1a_pri").value == "Other") {

  • Text field with autocomplete is always NULL

    Greetings,
    I am new to Apex so I am sure I am missing something obvious. I am using Apex 4.0.1 What I have done is created a form on a table page and added a new text with autocomplete page item. This new text field does not correspond to a column in the table. What I am trying to do is allow the user to use the autocomplete item to make a selection. Then when the user submits the page, I want to use the substr function on the value in the autocomplete field and populate one of the table fields. I have tried using PL/SQL functions in validations and computations but I have found that the value of the autocomplete field is always NULL. I can access the other fields that are associated with a table column fine. It must be something simple. Thanks for your help.
    Page Items
    P2_F1  - text field with auto complete. Not associated with a table column
    P2_F2 – Text field. Is associate with a table column
    This is what I want to do:
    Entered this in a validation
    begin
    if :P2_F1 is not null then
       :P2_F2 := substr(:P2_F1,1,5);
    end if;
    end;Thanks again
    Edited by: LRM on Jan 22, 2011 5:25 PM

    hi,
    The PL/SQL function can also work when you choose Computation point: After submit.
    For reading You can refer APEX documentation
    Application Builder User's Guide: http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/toc.htm
    To debug application:
    While you run your application in development environment, you can view debug option on footer .
    Click on it to on debug and again click to debug off.
    To view debug result click on View Debug option.
    Regards,
    Kartik Patel
    http://patelkartik.blogspot.com/
    http://apex.oracle.com/pls/apex/f?p=9904351712:1

  • Need help in text field with 2D array

    text field with 2D array
    Hi
    I need help to represent (i) in from field and (j) in to field
    I and j are 2D an array indices.
    This code are not complated
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    //declaring class
    public class test3 extends Applet implements ActionListener
    { //declaring the TextField
    private TextField fromField ,toField;
    //declaring an array
    int weight[][];
    int m = 99; // m is infinity
    int N; // Set of Nodes
    int d; // distance
    int i; // source Node
    int j; // destition Node
    //declaring values of text field
    private int from = i; // start Node
    private int to = j; // end node
    public void init()
    setBackground(Color.white);
    setForeground(Color.red);
    //giving labels
    Label TITLE2,TITLE1;
    TITLE1 = new Label("from:");
    add(TITLE1);
    fromField = new TextField(5);
    add(fromField);
    // register listener using void add actionListener
    fromField.addActionListener(this);
    TITLE2 = new Label("to");
    add(TITLE2);
    toField = new TextField(5);
    add(toField);
    // register listener using void add actionListener
    toField.addActionListener(this);
    // event handler methods
    public void actionPerformed(ActionEvent event) {
    //declaring textfield
    from=Integer.parseInt(fromField.getText());
    to=Integer.parseInt(toField.getText());
    weight =new int[7][7];
    weight[1][1] = 0; weight[2][1]= 2;
    weight[1][2]= 2; weight[2][2]= 0;
    weight[1][3]= 5; weight[2][3]= 3;
    weight[1][4]= 1; weight[2][4]= 2;
    weight[1][5]= 99; weight[2][5]= 99;
    weight[1][6]= 99; weight[2][6]= 99;
    weight[3][1]= 5;
    weight[3][2]= 3;
    weight[3][3]= 0;
    weight[3][4]= 3;
    weight[3][5]= 1;
    weight[3][6]= 5;
    for (int i=1; i<7; ++i) {
    for (int j=1; j<7; ++j)

    all your base are belong to us

  • How to add an animation to a text field with two lines?

    I have a text field with two or more lines. Why isn't it possible now to apply a text animation?

    For certain tasks, Titler and its Presets can be very good, and can simplify things greatly.
    However, when one gets beyond the limitations of the Titler, I really like to create my Titles in Photoshop, and Import those as Still Images into my Project. I then use the power of Keyframing various Effects over time. This allows me much more control, BUT does require more hand-work. Still, that added control is too important to me, and I sort of like doing the handwork.
    For the "alignment" of multiple Titles, to get multiple lines of Text, you can create the first Title, and then chose Duplicate Title. Initially, that will be identical, but you just change it, as is necessary. After you have changed that "second line of Text," place that Duplicate on the next Video Track, above the first Title, and use the Fixed Effect>Motion>Position, to move it down, to where it would be (by the height of the font, plus any desired Leading), if one had created a second line of Text on one Title.
    I also like to use Alignment Grids, when things get critical, and create those in Photoshop, with a trasparent background, and just place them, on say Video Track 2, with all of my Titles above that. Just do not forget to remove any Alignment Grids, before you Export/Share the Timeline, or they will be part of the output video.
    For more background on Keyframing (so very useful with more than just Titles), Steve Grisetti has done a multi-part tutorial, available as Basic Keyframing on Muvipix.com. I highly recommend it. Keyframing is simple to do, but can be a bit of a tough concept to grasp initially, and it's a subject that is tough to write about - takes longer to type instructions, than to do the work.
    Good luck,
    Hunt
    PS - Do not know if you saw them, but Titler has two Alignment Tools - Align Horizontally, and Align Vertically, that can be helpful to center Text.

  • Text field with autocomplete: little bug in application builder

    Hi,
    I just noticed that the application builder complains when a text field with autocomplete is defined with a named LOV containing a single column value (Apex 4.0.2.00.06).
    I created the text-field with a dynamic LOV (please specify in the docs that autocomplete requires single column queries!), then I used the "Convert to named LOV" task link to convert it to a named LOV and it works perfectly, however as soon as you attempt to change some other attribute for the item, it will throw the following error:
    1 error has occurred
        Using a named list of values (LOV) is only supported for item types which require at least two LOV columns.As i said, the named single column LOV works just fine with the autocomplete, so the error message seems to be also misleading.
    Flavio
    http://oraclequirks.blogspot.com
    http://www.yocoya.com

    Hi Surya,
    the "Text Field with autocomplete" is really just an autocomplete widget and doesn't behave like a LOV. But we are planning to release an item type plug-in which solves both of your requirements.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins

  • Apex 4.02 BUG: text field with autocomplete. wrong help text

    Following the wizard for a text field with autocomplete you reach a screen where you can enter a LOV query. The text area for the query has the following help text
    Enter the query that will return the list of values. The query must select two columns in the following order, first a display value then a return value. For example:
    select ename, empno
    from emp
    When selecting two identical columns, be sure to use unique column aliases, for example:
    select ename d, ename r
    from emp
    However the query should return only 1 value.

    Thanks Rene, I have fixed that in 4.1.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Auto populate blank text fields with n.a from a button or on print out.

    This seems straight forward but I cannot find an existing questions on this topic.
    I would like to add a form function that will fill any blank text fields with n.a. I do not want to use the default field value as I think it will cause confusion and cannot be applied for text fields formatted for dates. Is it possible to run a script that can do this? It would be OK if the action was triggered from a button or print activity after the rest of the form has been completed.
    Any thoughts would be appreciated.
    Thanks

    The question is whether your form is used only for filling out on screen (and not as a level 0 form, being printed out and filled out manually).
    If so, why not make the default value of the concerned fields to be "n/a" (or whatever you want to name them). That would relieve you from any validating before printing.
    Otherwise, you could maintain a list of field names which should get the n/a value if empty. This list would be an array.
    Your code in the willPrint event (if you want to have it reliably) would then look like this:
    for (var i = 0 ; i < nafieldarray.length ; i++) {
    if (this.getField(nafieldarray[i]).value == this.getField(nafieldarray[i]).defaultValue) {
    this.getField(nafieldarray[i].value = "n/a") ;
    HTH.
    Max Wyss.

  • Update Text Field with Vendor Account

    Dear Experts,
    I have a requirement where the user when executes APP F110 the field Text of the Bank Line Item should get updated with the Vendor Account Name so that whenever User executes GL Line Item Display for Bank Clearing Account user should get to know the Vendor Name.
    Is their a Standard functionality through which the same could be done.
    Regards
    Rahul

    Hi
    Try Substitution - OBBH
    New entries - Company code, Line item, Enter a Name
    Environment - Substitution - Create yes
    Select your substitution name - Select create step on top
    Select 'Field assignment' - Text field
    Prerequisite - Transaction code = Constant "F110"
    Substitution - Text = LIFNR
    Hope it helps
    Thank You,

  • Use 2 different fonts in a dynamic text field with tf.htmlText?

    i've got a dynamic text field on the screen and all of my
    fonts embedded. is it possible to use 2 different fonts when
    dynamically setting the fields text with the htmlText property?
    i've tried the <font> and the <textformat> tags and
    neither work. I can set it once via a texformat object, but that's
    it.
    thanks

    you're answering all of my questions today aren't you? :)
    right, i think this will be hard since my data is all comming
    from XML and i have no way to specifically set text ranges as
    different fonts within a string.
    i've told the developers to just use images for the special
    characters.

  • Import Text Data to text fields with folder level script

    I am using Adobe 9 professional and have a folder level javascript to import text into existing fields of a pdf.
    There are multiple fields with multiple rows of data to be imported.
    The folder level script is not working (but there are no errors in the console showing when run)
    I have manually tested opening the text file with the following code in the console and the text file opens and populates the text fields, so the text file must be correct:
    this.importTextData();
    The following code is the folder level script which is not working:
    function mailmergeFunction()
    // Import the first row of data from "Mailmerge.txt"
    this.importTextData("/h/mail merge/Jo Smith's Things/Mailmerge.txt", 0)
    if (typeof cnt == "undefined") cnt = 0;
    this.importTextData("/h/mail merge/Jo Smith's Things/Mailmerge.txt", cnt++ % 4)
    app.trustedFunction(mailmergeFunction);
    app.addToolButton({cName: "Mail merge",cExec: "mailmergeFunction()",cTooltext: "Mail Merge",cEnable: true,nPos: 14});
    If anyone can please provide some assistance, it will be most appreciated thanks.

    Working fine now, changed the location of the file path - could have been something to do with having an apostrophe.
    function mailmergeFunction()
    app.beginPriv()
    // Import the first row of data from "Mailmerge.txt"
    this.importTextData("/h/mail merge/Mailmerge.txt", 0)
    if (typeof cnt == "undefined") cnt = 0;
    this.importTextData("/h/mail merge/Mailmerge.txt", cnt++ % 4)
    app.endPriv()
    app.trustedFunction(mailmergeFunction);
    app.addToolButton({cName: "Mail merge",cExec: "mailmergeFunction()",cTooltext: "Mail Merge",cEnable: true,nPos: 14});
    Thank you for your assistance George, much appreciate your help.

Maybe you are looking for