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