• 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: Multiple hidden fields appear on click.

Multiple hidden fields appear on click. 12 years 8 months ago #14635

  • rex3
  • rex3's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
want to make several fields appear upon select eg. select radio drop down 10 and 10 Address fields then appear. I've been attempting to do this with the script you provide "show hide other radio example" but with no success.
Any help much appreciated.
I can get one form item to appear but not several at once.

This is what i have atttempted - no success. (here using the && to place more than one form item together)


<script type="text/javascript">
function displayField(field)
{
if(document.getElementById('AssetOther1').checked)
document.getElementById('TEST1'&&'TEST2').style.display="";

else {
document.getElementById('TEST1'&&'TEST2').style.display="none";
document.getElementById('form1firstnameother'&&'Form 1 middle name other').value="";
document.getElementById('component1888'&&'component1889').setAttribute("class", "formNoError");
}
}

function validateFields()
{
if(document.getElementById('AssetOther1').checked && document.getElementById('form1firstnameother'&& 'Form 1 middle name other').value == '')
{
document.getElementById('component1888'&&'component1889').setAttribute("class", "formError");
return false;
}
else
return true;
}

window.addEvent('domready', function() {
displayField();
});


</script>

I've also attempted just writing multiple script like this:


<script type="text/javascript">
function displayField(field)
{
if(document.getElementById('AssetOther1').checked)
document.getElementById('TEST1').style.display="";

else {
document.getElementById('TEST1').style.display="none";
document.getElementById('form1firstnameother').value="";
document.getElementById('component1888').setAttribute("class", "formNoError");
}
}

function validateFields()
{
if(document.getElementById('AssetOther1').checked && document.getElementById('form1firstnameother').value == '')
{
document.getElementById('component1888').setAttribute("class", "formError");
return false;
}
else
return true;
}

window.addEvent('domready', function() {
displayField();
});





function displayField(field)
{
if(document.getElementById('AssetOther1').checked)
document.getElementById('TEST2').style.display="";

else {
document.getElementById('TEST2').style.display="none";
document.getElementById('Form 1 middle name other').value="";
document.getElementById('component1889').setAttribute("class", "formNoError");
}
}

function validateFields()
{
if(document.getElementById('AssetOther1').checked && document.getElementById('Form 1 middle name other').value == '')
{
document.getElementById('component1889').setAttribute("class", "formError");
return false;
}
else
return true;
}

window.addEvent('domready', function() {
displayField();
});

</script>
The administrator has disabled public write access.

Re: Multiple hidden fields appear on click. 12 years 8 months ago #14636

Rex,
Send a email to me at This e-mail address is being protected from spambots. You need JavaScript enabled to view it and I'll send you a sample for I had done that might help with what you want to do. While it's not exactly what you are asking for, it might be close. And it seems you can write code so you may be able to adapt it to what you need to do.
Regards,
Kathy Ahrendt
www.nemgtr.org
See example at www.nemgtr.org/index.php?option=com_cont...application&catid=39
The administrator has disabled public write access.

Re: Multiple hidden fields appear on click. 12 years 5 months ago #15606

Hello Rex, I am having the same issue also, were you able to solve yours? And if so, can you share your code with me so that I may do the same with my form?

Thank You
Joseph
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!