Il nome utente o la password che hai inserito non sono corretti.

Iscrizione

Purtroppo questo nome utente esiste gia'!

Questo indirizzo e-mail esiste gia!

Il codice di verifica non coincide

Tutti i campi sono obbligatori

RSJoomla! Forum :: Topic: RESOLVED: help with checkbox Javascript function (1/1)

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

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: RESOLVED: help with checkbox Javascript function

RESOLVED: help with checkbox Javascript function 1 year 2 weeks ago #17281

Hello,
I have four check boxes. Dog, Cat, Other, None of These. If Dog Cat and Other is checked that is fine but if the check box "None of These" is checked I need it to remove the check from all other boxes.

This is an example of exactly what I need my form to do jsfiddle.net/srEuM/

Does anyone know how I can accomplish this with RS Form Pro? I have been messing with this for days and could really use some help.
Thank you
Deziner
Where there's a will there's a way
Last Edit: 1 year 2 weeks ago by deziner76hd. Reason: resolved
The administrator has disabled public write access.

Re: help with checkbox Javascript function 1 year 2 weeks ago #17284

This is the Javascript I am using right now but it isn't giving me the complete results I need.
<script type="text/javascript">
function checkI()
{
 var checkL = document.getElementsByName('form[PetsInHouse][]');
   for (var i=0;i<checkL.length-1;i++)
     if(document.getElementById('PetsInHouse3').checked){
      document.getElementById('PetsInHouse'+i).disabled = true;
      document.getElementById('PetsInHouse'+i).checked = false;
     }
     else {
      document.getElementById('PetsInHouse'+i).disabled = false;
     }
}
</script>
Where there's a will there's a way
The administrator has disabled public write access.

Re: help with checkbox Javascript function 1 year 2 weeks ago #17297

I have resolved the issue like this

Javascript code:
<script type="text/javascript">
function checkI()
{
var other=0;
 var checkL = document.getElementsByName('form[PetsInHouse][]');
   for (var i=0;i<checkL.length-1;i++){
     if(document.getElementById('PetsInHouse3').checked){
      document.getElementById('PetsInHouse'+i).disabled = true;
      document.getElementById('PetsInHouse'+i).checked = false;
		}
     else {
      document.getElementById('PetsInHouse'+i).disabled = false;
		}
		if(document.getElementById('PetsInHouse'+i).checked){
		other++
		}
	 }
	 document.getElementById('PetsInHouse3').disabled=other>0?true:false;
	}
</script>

And used this call in the additional attributes:
onclick="checkI();"
Where there's a will there's a way
The administrator has disabled public write access.
  • Page:
  • 1
Powered by Kunena Forum
Feedback