I am using the following code to retrieve URL params into a JavaScript variable.
function getUrlParams() {
var params = {};
window.location.search.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(str,key,value) {
params[key] = value;
});
return params;
}
var vName = getUrlParams()["vName"];
I have to set vName
into h:inputText
.
document.getElementById("Forid:Fldid").value = vName; // didn't work
I am working on Facelets.