How to use getElementByID - Websphere

This is a discussion on How to use getElementByID - Websphere ; Hi all I have an output box that i have to retrieve the value to a Javascript var. utputText id="text01" styleClass="outputText" value="#{session.price.uph4lb8tprice}"> utputText> but in the Javascript i cannot retrieve this value with the getElementByID. var test = document.getElementById("test"); var ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: How to use getElementByID

  1. How to use getElementByID

    Hi all

    I have an output box that i have to retrieve the value to a Javascript var.

    utputText id="text01" styleClass="outputText" value="#{session.price.uph4lb8tprice}">utputText>

    but in the Javascript i cannot retrieve this value with the getElementByID.

    var test = document.getElementById("test");
    var b = test.value;
    alert(b);

    it always returns "missing object"

    Am I doing something wrong, how can I acess that element?

    Thanks in advance.




  2. Re: How to use getElementByID

    JSF ids are namespaced, the real element's id isn't "test", it would be somehting like "viewPC_skjadhskjdh:test". Open the page source in the browser to see the real id.

+ Reply to Thread