Forums Register Login

How to use javascript to hide a jsf form element question

+Pie Number of slices to send: Send
I'm tyring to hide a <h:selectOneListbox when a user selects a radio button. When the radio button is clicked, I call a javascript function to hide the component, but the component does not get hiden. I've verified the component id is correct. Can someone tell me what I'm doing wrong in my js?

thanks

document.getElementById("geoUpdater_1_j_id_id0:myForm:geoType").hide();
+Pie Number of slices to send: Send
I think the recommended way these days is to set the "visible" attribute false. Or there's a screwball block-render option whose details I forget. JavaScript is a bit tough in that area.
+Pie Number of slices to send: Send
Thanks for the reply, I figured it out late last night.

if ("ASSET" == radio){
document.getElementById(comp).style.display = 'block';
} else {
document.getElementById(comp).style.display = 'none';
}
+Pie Number of slices to send: Send
Yep. That was the "screwblass block option". you found it.

Incidentally, meant to say "JavaScript is a bit rough in that area." Sometimes my keyboard has a mind of its own.
Space pants. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 4196 times.
Similar Threads
AJAX or JavaScript
how do you spread the radio buttons of a selectOneRadio
requirement gathering for User Interfaces
radio button inside a datatable
how to hide some component using javascript
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:58:20.