| Author |
How to use javascript to hide a jsf form element question
|
Dan MacLeod
Ranch Hand
Joined: Mar 19, 2009
Posts: 30
|
|
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();
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14573
|
|
|
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.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
Dan MacLeod
Ranch Hand
Joined: Mar 19, 2009
Posts: 30
|
|
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';
}
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14573
|
|
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.
|
 |
 |
|
|
subject: How to use javascript to hide a jsf form element question
|
|
|