Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem javascript

 
rosaria italia
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have a problem in my jsp page. I recover a value from <h:inputText> to JavaScript with following code:
<SCRIPT type="text/javascript">
function valorizza ()
{var form=document.getElementById("myForm");
var id=document.getElementById("myForm:id").value;
document.getElementById("myForm:id2").value=id;
alert("id2="+id2);
}

But I'd like to recover a value dynamically, without to write element's name (myForm:id). What do I do? Can you help me? Thanks in advanced!
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"rosaria"

You had your real first name and real last names showing before. Why did you change it. You need to set it back, because now it violates the JavaRanch Naming Policy of using your real first and real last names. Please click on the My Profile link above.

Thanks

Mark
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry, I don't understand what you are trying to do. Could you please elaborate?

Also, does this really have anything to do with JSF? I'm inclined to move this to the JavaScript forum...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic