I have a Edit Box control with Name : “config_value”
I have a button control coded with the following client side java_script in it
var x=document.getElementById(‘#{java_script:getClientId(“config_value”)}’).value
alert (x);
This alerts what ever I put into the editbox control when I click the button.
But when I split up the same code in the following fashion it fails.
var test=‘“config_value”’;
var x=document.getElementById(‘#{java_script:getClientId(’+test+‘)}’).value
alert (x);
and the same gives me the following error message
The runtime has encountered an unexpected error.
500 Exception
Error while executing JavaScript action expression
Script interpreter error, line=1, col=1: Invalid component name
I have attempted eval() commands as well and it gives me the same error as well
It is mandatory that I should pass the id through a variable as mentioned in the second code fragment.
Please suggest me a work around for this issue
Thanks in Advance
(I have purposely used the word java_script for the sake of this post only.)