• 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: hidden options of drop-down according to a date

hidden options of drop-down according to a date 5 years 1 month ago #39961

I would like to share with you this code which allows you to delete options from a drop-down list according to a date.

<script type="text/javascript">

window.addEventListener("load",function(){

//jour et mois début de la saison
const mois=3;
const jour=13;

// Value de ma liste déroulante
var maListe = document.getElementById('type_competition');

var d = new Date();
// date de fin apparition ensemble liste déroulante type compétition
var date_fin = d.getFullYear()+','+(mois)+','+(jour);
// conversion date
var date_conv = Date.parse(date_fin);
var date_maint = Date.parse(d);

//Si date conv est après maintenant alors on supprime sélective et manche de coupe de France de la liste déroulante
if (Number((date_conv)+ 8.64*Math.pow(10,7)) < date_maint){

// on supprime les champs Manche de coupe de France 3 et Sélective 2 de la liste déroulante
maListe.removeChild(maListe.childNodes[3]),
maListe.removeChild(maListe.childNodes[2]);

}},false)

</script>
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!