This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JSF and the fly likes select the chekbox generated at runtime of jsf page using javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "select the chekbox generated at runtime of jsf page using javascript" Watch "select the chekbox generated at runtime of jsf page using javascript" New topic
Author

select the chekbox generated at runtime of jsf page using javascript

Amit K Jain
Ranch Hand

Joined: Nov 06, 2008
Posts: 55

Hi,

Can someone please help me selecting the checkbox using javascript? Belew is the view source of the JSF form. On clicking the first checkbox another one should get selected automatically.



I tried to get the value of the checkbox, however, it doesn't work.

Please advise.

Regards
Amit
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

That's not a JSF form. It doesn't use JSF tags and doesn't bind to a JSF backing bean. It's just plain old HTML.

JavaScript's interactions with checkboxes is done using the "checked" property, I think. Not the "value" property.


Customer surveys are for companies who didn't pay proper attention to begin with.
Amit K Jain
Ranch Hand

Joined: Nov 06, 2008
Posts: 55
Thank you Tim for the response.
Yes. This is not JSF form but the view source of the page created after rendering the JSF page. I have resolved this problem using checked property of the checkbox.

Thanks
Amit

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

Amit K Jain wrote:Thank you Tim for the response.
Yes. This is not JSF form but the view source of the page created after rendering the JSF page.


Sorry. I missed those 2 key words (view source). Doesn't matter. Same solution either way. Anyway, all fixed.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: select the chekbox generated at runtime of jsf page using javascript