• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Can't hide fields conditioned by radio button

Can't hide fields conditioned by radio button 12 years 7 months ago #15087

Hi,

I have a radio button named 'Volksbank' and I want to hide 'Tara' and 'Loc' fields when the radio button is not checked or checked with "NO"("No" being the second option").

I used this code according to the documentation:
<script type="text/javascript">
function displayField()
{
if(document.getElementsByName('form[Volksbank]')[0].checked)
{
document.getElementById('Tara').style.display="";
document.getElementById('Loc').style.display="";
}
if(document.getElementsByName('form[Volksbank]')[1].checked)
{
document.getElementById('Tara').style.display="none";
document.getElementById('Loc').style.display="none";
}}
window.addEvent('domready', function() {
displayField();
});
</script>

Also, when I check the "NO" button, the fields get hidden but the descriptions of the fields remain.

I do have javascript knowledge.
What am I doing wrong?

Thanks.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!