Can't access a value stored in a form text field

I created a small test page to try and understand how a piece of javascript works, well actually it's not working. All I'm trying to do is display the value entered in a text field in a form and it's failing with 
SCRIPT5007: Unable to get value of the property 'value': object is null or undefined 
temp.php, line 39 character 1
The line it's failing on is this
x = document.getElementById("otherChoice").value;
The page can be seen here www.hollisterairshow.com/temp.php
I just don't understand why it thinks the text field is undefined when it clearly is. I'm using DW CS4 and IE9.
Thanks for any pointers you might have.
Tony

Thank you so much, I've been struggling with this for almost a week now.
Just to complete the answer, I had to assign an ID to the text field and also to the "Other" button so that the JS could access both when it moved the value from the text field to the Button which was the original problem I was trying to solve.
Thanks again for the assistance, much appreciated.
Tony

Similar Messages

  • I loos my APPLE ID, I have a new one, how can get access to data stored in the old one?

    I loos my APPLE ID, Now I have a new one, how can get access to data stored in the old one?

    Do you have the email & password of the old Apple ID?

  • How can i get the value stored in the session object using its sessionid

    how can i get the value stored in the session object using its sessionid by running stand alone java application

    myforum wrote:
    how can i get the value stored in the session object using its sessionid by running stand alone java applicationThis does not seem to make sense! You need at least to give a lot more detail of what you are doing.

  • Can I access my files stored in the hard disk connected to airport extreme when I am away? how?

    Can I access my files stored in the hard disk connected to airport extreme when i am away? How?

    You can't technically. iPads cannot directly read HDDs like a computer can. 
    You will need an app liie FileBrowser to do this. Of course all file operations will be done through the App itself.
    https://itunes.apple.com/us/app/filebrowser-access-files-on/id364738545?mt=8

  • HT1414 I am unable to restore my IPhone from a previous back up as the password appears to be incorrect, how can I access a previously stored back up?

    I am unable to restore my IPhone from a previous back up as the password appears to be incorrect, how can I access a previously stored back up?

    Use the correct password. If you don't know it there is no way to bypass it.

  • LOV return value to submit multi LOV/Text field order by value!

    I have nested LOV and return value reflected to another LOV/Text field by order wise.
    My problem,
    The return value LOV or Text field should be dispay with one by one values order by (Dynamic).here i using the query in each LOV source.
      select DMS_DD_ENG_DESC dis, DMS_DD_ID ret from DMS_DEPT_DETAILS
    where DMS_DD_DT_REF_ID=:P3_DETAILS
    Workspace          :RAM_R&D
    User Name/Password :aramani/apex
    App                http://apex.oracle.com/pls/apex/f?p=36167:3I should do the dynamic action for this case?
    anyone can help me plz.
    Thanx,
    Ram

    Hi Ram,
    I changed your application and i think it is working the way you want.
    I don't know if it exactly what you need but take a look and let me know.
    Regards,
    Kees Vlek
    <tt>Company: http://www.orcado.nl
    Blog: http://www.orcado.nl/blog/blogger/listings/69-kvlek
    Twitter: http://www.twitter.com/skier66</tt>
    If the question is answered please change it to answered and mark the appropriate post as correct/helpfull.

  • How can I access the values in ProfileArray of a CWIMAQProfileReport?

    Hi all,
    I'm not sure if this is the right board, but I didn't find one related to VB and NI Vision.
    I'm using LineProfile2 from CWIMAQVision1 which gives me a ProfileArray which is a variant. I'd like to access the
    values in the array. Normally I would do it like
    Report(1).ProfileArray(i)
    but that does not work. I can get the bounds of the array with LBound and UBound. I can observe the array in 
    debug modus and it contains reasonable values.
    How can I get access to the contents of the ProfileArray?
    Thanks in advance
    Axel

    Hi Elmar,
    thanks for paying attention to my problems.
    I use Vision 8.5. My email adress is [email protected]
    I don't need the hole intensity of the image/2D array. I only need the
    intensity values of a given line which should be a 1D array of bytes.
    I use the following command
            CWIMAQVision1.LineProfile2 Image, Line, Report
    When I understood the command correctly the intensity values are
    in the Report. I would get them with 
            Report(1).ProfileArray(i)
    But that does not work. I get a runtime error #450.
    Other stuff with the report works and gives reasonable values e.g.
                Report(1).PixelCount
                LBound(Report(1).ProfileArray)
                UBound(Report(1).ProfileArray)
    Or passing the hole array to plot the values also works
            frmLineProfile.CWGraph1.PlotY Report(1).ProfileArray
    Best regards,
    Axel

  • How can we access the value set to a search criteria's attribute

    Hi guys,
    Is there any way to access the value which was set to a search criteria's attribute programmatically in the backing bean?
    Regards !
    Sameera

    Check sample 85 from the adf code corner sampleshttp://www.oracle.com/technetwork/developer-tools/adf/learnmore/85-querycomponent-fieldvalidation-427197.pdf
    Frank shows how to access the variables.
    Timo

  • How to use javascript to access item VALUES on a portal form

    Hi,
    I want to pick up VALUE of an item on a portal form from the on click event of the save button. I know there is a way to acces the item name and assign a value to that item. For example,
    setItemValue(this.form,'UNIT_NAME', this.value)
    If I use this line of code then I get the value of the save button because I put this line of code in the on click event of the save button. Please help.
    Monique

    You can get hold of any field on your form as follows:
    document.forms[0].elements['<form>.DEFAULT.<field>.01']
    So for example to get (or set) a value in my form I have:
    document.forms[0].elements['REQUESTFRMEU.DEFAULT.BUS_OBJ.01'].value
    Note that setting a value of a field with Javascript on the Insert button's onclick event will not result in the new value being sent to the DB. I think it has to do with the values being set into a session object of sort and the DB gets updated from these values and when you update the field with JS it does not update thesee session values. If you set the value somewhere else (e.g. another event handler before the Insert button is clicked) you should be OK.
    Cheers.
    Anton.

  • How do I set the value of a dynamic row text field

    I have a repeated row form which contains a button and multiple text fields.  There is a text field (Input Data Field) further up with some information I want to place in the table and multiple buttons that I want to read the value of and set to the table.  I apologize there are multiple questions I have and I am using pseudocode to describe it.
    Top form looks like
    InputField
    | ButtonX1 | ButtonY1 | DescriptionX1 (read only Text Field)
    | ButtonXn | ButtonY1 | DescriptionXn
    OutputRow looks like
    | ButtonOutput | OutputField1 | OutputField2 | OutputField3 |
    So I would like it to do
    ButtonX1.click
    OutputTable.OutputRow.addInstance(true)  //this works - everything else I have questions on
    OutputTable.OutputRow.OutputField1.rawValue = DescriptionX1.rawValue
    Question 1
    How do I address the location in each table to set a value
    Question 2
    How do I get the value of the description field in the same table and row as the button
    I would like to say something to the effect of  OutputTable.OutputRow[??].OutputField1.rawValue = this.parent.DescriptionX
    OutputTable.OutputRow.OutputField2 = InputField.rawValue
      Same question as above - how do I specify a dynamic row - is this the proper syntax for getting the value from the input field?
    OutputTable.OutputRow.OutputField3 = this.ButtonLabel
    Question 3
      How can I get the value of the button's label to set in the field
      There should be very many of these buttons and buttons will be added - I would prefer to set the value based on the button's label to make the value easier - not requiring changing the code
    Question 4 - unrelated to those above.
    Is it possible to build the first table
    | ButtonX | ButtonY | Description |
    from an XML File.  I have seen examples of how to build if it is just data, but can the XML be pushed into a form with code to do the above actions?

    Each object in a form must have a unique name. I doing so it is not neccessarily the name but the path or SomExpression associated with that object that must be unique. In your case you have a Table.Row.object configuration. The Row is the part that is repeating so to give each object a unique name an instance number is placed on the repeating part. So objects in the 1st row woudl be Table.Row[0].object...objects in the second row woudl be Table.Row[1].object etc .....You can see this by adding a debug instruction on the Enter event of the description field. Put the code app.alert(this.somExpression) and when you enter the field you will see what the somExpression is. Do this for a few rows and you will see the pattern (don't forget to remove the debug code from the enter event). Now you know what you have to use to address the fields. If no instance is given it is assumed to be 0 ..that is why only the 1st row is being affected.
    So now to answer your questions:
    Question1: The square bracket notation is an issue for javascript (this is the notation for an array) so we have to use a different means of addressing the field to include the instance number. So to address the Description in the 3rd row we woudl use:
    xfa.resolveNode("Table.Row[2].Description").rawValue = "This is my new description";
    Note that the instance number is 2 for the 3rd row because the instance numbers are 0 based.
    Question2. The resolveNode notation allows you to pass a string so you can also concatinate expressions to make the string. If you are writing code on a button in the same row you can get the instance that you are on by using the expression this.parent.index. The "this" portion refers to the current object (the button) and the parent.index gets you th eindex of the Buttons parent. If the button is embedded deeper in a hierarchy then you can continue to add parent indicators until you get back to the node that you want. So rewriting your expression from Q1 it woudl be:
    xfa.resolveNode("Table.Row[" + this.parent.index + "].Description").rawValue = "This is my new description";
    Question3: The buttons caption can be retrieved by using ButtonName.caption.value.text.value
    Question4: When you say build from an XML file. What are you expecting to come from the XML file? The caption that goes on the button? Typically the XML file carries data (not to say that it cannot carry other things). Just need a bit of clarification on this one first.
    Hope that helps
    Paul

  • Copy value in drop down to text field

    Hi,
    I am not sure what the best solution for this may be.
    I have a form (ASP/VB) it has a drop down menu and two text
    fields.
    The drop down displays the names of people, but the value of
    each is their
    email, the text fields is a 'to' field and a 'cc' field.
    I want user to be able to select any of the names and click a
    "email 'to" or
    "email 'cc'" when they do that copy the values of each field
    into the 'to'
    box or the 'cc' box depending on the button that is clicked
    on., so if user
    selects "ana", "bob" and "john" and clicks on "email 'to'",
    their emails are
    copied to the 'to' text box, having as a result:
    [email protected], [email protected], [email protected] and user can
    still enter a
    few more emails in the 'to' box if necessary.
    If anyone knows of a tutorial that would be great !
    Thanks for any pointers.
    Aleks

    google capturing form values with javascript.
    Read about the DOM (Document Object Model).

  • Can't have both _alpha control and html in text field?

    I have a dynamic text field "text_mc.myText_txt" within a
    movieClip. I want the text to fade in and out using the Tween
    class. I also want it html formatted so I can apply a stylesheet.
    What I see is that in order to have the tween work, the field must
    have the text imbedded. But by imbedding the text, the html styling
    won't work. Is there a work around for this?
    thanks

    fm GUI_UPLOAD will not work in background
    you need to use
    lv_filename = <input file path> " app server path
    open dataset lv_filename for input in text mode encoding default.
        if sy-subrc = 0.
          do.
            read dataset lv_filename into gs_input-wa_string.
            if sy-subrc eq 0.
              append gs_input to gt_input.
            else.
              exit.
            endif.
          enddo.
          close dataset lv_filename.
        endif.

  • Storing comment in a text field

    Hello everyone. Hope you are all well.
    Have a bit or of a problem.
    I have imported and XML file and using the code below i am
    able to store comments against a particular node.
    //istener object for tree
    var lo:Object = new Object();//a custom object called "lo" is
    created.
    lo.change = function(evtObj:Object):Void{
    var itm:Object = mytree.getSelectedItem();
    if(itm.savedComment != undefined)
    newcomment.text = itm.savedComment;
    else
    newcomment.text = "";
    mytree.addEventListener("change",lo);//everytime the tree
    component generates a change event
    //from the user selecting a different node the listener code
    runs.
    //listener object for submit button
    var lo2:Object = new Object();
    lo2.click = function(evtObj:Object):Void{
    var itm:Object = mytree.getSelectedItem();
    itm.savedComment = newcomment.text;
    addCommentbtn.addEventListener("click",lo2);
    All i need now is that whenever the user clicks on a button
    ("viewComment") ALL the comments already submitted are presented in
    a dynamic text field.
    ANy help is much appreciated. Thanks.

    This method works for a Text Field but can you text wrap and expand to fit the height of a cell that is a Drop-down List. The Expand to fit check box on the Layout palette is greyed out for all my Drop-down boxes. I have also tried using the following JavaScript:
    var newHeight = xfa.layout.h(DropDownList, "in");
    Textbox.h = newHeight + "in";
    but it doesn't work. Any suggestions?

  • How can I access the value of a loop index outside the loop?

    I have a sequence structure in Labview 8.6.  At one frame of the sequence I have a while loop.  The loop runs for a while and then stops and the program then moves to the next frame of the sequence.  Several frames further on down the sequence I have a cluster, the elements of which are outputs on the front panel.  The index of the mentioned loop is one of the cluster elements, an numeric output.  While the loop is running, I want the index to be displayed on the front panel in the output contained in the cluster.  How can I do this?

    The easiest way to do this is to use a local variable of your cluster.  You'll need one copy set to read; connect that to a bundle by name, bundle in your index value from the loop, and wire the bundle output to a write copy of your local variable.  You can create a local variable by right-clicking on the cluster terminal (in the block diagram) and choosing create local variable.  You can change the local variable to read or write by right-clicking on it.
    However, in general the use of both local variables and sequence structures is discouraged, and the right solution may be to rewrite your code with a while loop containing a case structure in which you update the cluster every time through the loop.  This will look like a state machine; you'll also need a shift register in place of the loop iteration counter.  If you post your code (ideally the VI, but if not then a screenshot of the block diagram) then we can provide more useful assistance.

  • Can I Access the Value of a Global Variable in a Trigger

    I'm using a Global variable in a Package which i use in the BIU Trigger to populate a column. After assigning the value for that global variable, I run an INSERT in the same package. But I find only the default value of the Global variable populated in the column. Can I use a Global Variable in a Trigger? Is there any way to put in a common value across all the tables in an application for all DMLs of a particular session?

    Helios,
    I'm already having the same setup mentioned in the thread. And I'm doing exactly whats given there. But the issue seems to be something different. I'm assigning the value to the Global Variable in the Package through Apex. Here's the Package Code:
    CREATE OR REPLACE PACKAGE Schema1.SPMS_SECURITY_PKG
    AS
    X_app_user_id NUMBER DEFAULT -1;
    FUNCTION USER_ID RETURN NUMBER;
    END SPMS_SECURITY_PKG;
    CREATE OR REPLACE PACKAGE BODY Schema1.spms_security_pkg
    AS
    FUNCTION user_id
    RETURN NUMBER
    IS
    BEGIN
    -- RAISE_APPLICATION_ERROR(-20001,'USER ID'||'*'||X_app_user_id);
    RETURN NVL (x_app_user_id, -1);
    -- RETURN NVL (sys_context('USERENV', 'CURRENT_USER'), -1);
    EXCEPTION
    WHEN OTHERS
    THEN
    RETURN -1;
    END;
    And Here is the Trigger Code:
    CREATE OR REPLACE TRIGGER Schema1."USER_DETAILS_TRIGGER"
    BEFORE INSERT OR UPDATE
    ON PMS_SICAL.SPMS_USER_DETAILS REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    BEGIN
    IF INSERTING
    THEN
    :NEW.created_by := spms_security_pkg.user_id;
    :NEW.created_date := SYSDATE;
    :NEW.START_DATE := SYSDATE;
    ELSIF UPDATING
    THEN
    :NEW.updated_by := SPMS_SECURITY_PKG.X_app_user_id;--spms_security_pkg.user_id;
    :NEW.updated_date := SYSDATE;
    END IF;
    END;
    But I always get -1 in the both in the table after the DMLs.

Maybe you are looking for