• 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: Conditional field

Conditional field 1 year 1 week ago #42732

  • dubois
  • dubois's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Hello I select a select in a list in javascript with
document.getElementById('age1').selectedIndex = 3;
it shows me the 4th value of the list.
I then want to add a conditional field in relation to the value of this select but the condition does not work. If I choose myself a value in the list the condition works.
Do we need to add something for the condition to execute?
THANKS
Last Edit: 1 year 1 week ago by dubois.
The administrator has disabled public write access.

Conditional field 1 year 5 days ago #42737

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 213
  • Thank you received: 57
I think you need to change the display property for the field you want to hide from 'display' to 'none' or if the selected index in the age1 field is 3. Opposite way round to show it if 3 is selected,
something like
if (document.getElementById('age1').selectedIndex = 3) {

document.getElementById('conditionalFieldName').style.display = "none"; //to hide
document.getElementById('conditionalFieldName').style.display = "block"; // to show
}
If you can keep your head when all about you are losing theirs, then you obviously don't understand the situation!
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!