mercredi 25 janvier 2017

Python flask checkbox does not change value back to false onclick in HTML view

I noticed that 4 of my checkboxes do not change the value back to false if clicked on them. I am unsure wether it always have been like that. Actually I remember it had worked fine.

I searched now for 2 hours everywhere and still cant find a reason why this happens, I mean all the other checkboxes do work fine.

I am even trying to restore this default behaviour with jquery:

$(document).ready(function() {
  if ($(".zimmer-gefunden")[0]) {
    $("#einzelzimmer_first").change(function() {
      if (this.checked) {
        $("#einzelzimmer_first").prop('checked', false);
      } else {
        $("#einzelzimmer_first").prop('checked', true);
      }
    });
  }
});

That is the website where the problem occures, the checkboxes are EINZELZIMMER, DOPPELZIMMER, MEHRBETTZIMMER and WOHNUNG

If clicked the first time they become true and trigger the results to be filtered and if clicked again it has to become false again and restore the old filtering.




Aucun commentaire:

Enregistrer un commentaire