• 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: Javascript to conditionally disable ticket

Javascript to conditionally disable ticket 9 years 8 months ago #32211

Hi,

I've got a form where people can register for an event. They can choose their profession from the "Beroep"-dropdownlist, there you can choose several items.

Here's the dropdownlist:
|Selecteer a.u.b.[c]
Anesthesioloog
Cardioloog
Chirurg
Dermatoloog
Geriater
Gynaecoloog
Internist
Jeugdarts
Kaakchirurg
Kinderarts
KNO-arts
Longarts
MDL-arts
Neuroloog
Neurochirurg
Oogarts
Psychiater
Radioloog
Specialist overig
Bedrijfsarts
Huisarts
Verzekeringsarts
Apotheker
Apotheker (i.o.) <- item 24
Ziekenhuisapotheker
Ziekenhuisapotheker (i.o.) <- item 26
Tandarts
Fysiotherapeut
Gezondheidswetenschapper
Gezondheidszorgpsycholoog
Psychotherapeut
Verloskundige
Verpleegkundige
AIOS <- item 34
ANIOS 
Arts-Onderzoeker <- item 36
Onderzoeker in Opleiding
Gepensioneerd <-item 38
Student <- item 39

I've added this to the attributes of that dropdownlist:
onchange="myTicketFunction();"


And this to the javascript part:
<script type="text/javascript">
function myTicketFunction()
{
    if(document.getElementById('Beroep')[24].value = true) 
        document.getElementById('RSEProTickets')[0].disabled = true;
    } else if(document.getElementById('Beroep')[26].value = true) {
        document.getElementById('RSEProTickets')[0].disabled = true;
    } else if(document.getElementById('Beroep')[34].value = true) {
        document.getElementById('RSEProTickets')[0].disabled = true;
    } else if(document.getElementById('Beroep')[37].value = true) {
        document.getElementById('RSEProTickets')[0].disabled = true;
    } else if(document.getElementById('Beroep')[38].value = true) {
        document.getElementById('RSEProTickets')[0].disabled = true;
    } else if(document.getElementById('Beroep')[39].value = true) {
        document.getElementById('RSEProTickets')[0].disabled = true;
    } else {
        document.getElementById('RSEProTickets')[1].disabled = true;
}
</script>
window.onload = function() {
    myTicketFunction();
};

But that's not completely working. What am I missing here? Can anyone point me to the right direction? The form is here: www.surinamedag.com/symposium/index.php/...n/1-surinamedag-2015

Thanks a lot and best!

Sander
Last Edit: 9 years 8 months ago by swvanderlaan.
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!