my dog learned polymorphism*
The moose likes JSF and the fly likes problem javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "problem javascript" Watch "problem javascript" New topic
Author

problem javascript

rosaria italia
Greenhorn

Joined: May 15, 2006
Posts: 28
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

Joined: Feb 05, 2001
Posts: 17249
    
    6

"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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
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...


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem javascript
 
Similar Threads
Javascript calculator issues
Internationalized messages in javascript
JQuery: How to get the value updated in a javascript file
JS code not working.
argument in form access