• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javascript value to JSF

 
Shruthi Sam
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a jsf page with a hidden field. In the javascript am setting the value of the hidden component. whenever i submit this, am not getting the value of the hidden field set by javascript. Please let me know how to achieve this. (I want to pass a javascript value to my bean.)
 
Pardha Reddy
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

var varName = document.getElementById(formName+":hiddenField1"); // Here hiddenField1 is id attribute of hidden field.
varName.value="assignmentValue";

This is how variable be assigned to hidden field in javascript. Cross check your syntax once.

Thanks
Pardha
 
Vaibhav Mittal
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
refer to this link. It describes everything you need to know on this topic very clearly.
 
Shruthi Sam
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vaibhav & Pardha,

Thanks a lot for your replies. It is working now. Thanks again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic