Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

122
Views
Mousedown on a dropdown menu not working same on different browsers

I have a Django app. On my html page I have a dropdown menu which fills from DB when you click with mouse on it:

    <script>
        $("#div_id_res_person_1").mousedown(function () {
            $("#id_res_person_1").empty();
            $("#id_res_person_1").append("<option>" + '---------' + "</option>")
            var value_1 = $("#id_report_division").val();
            var value_2 = $("#id_report_sector").val();
            var value_3 = $("#id_report_department").val();
            var url = $("#PostForm").attr("data-person-url");
            console.log("a")
            $.ajax({
                url: url,
                data: {
                'divizija': value_1,
                'sektor': value_2,
                'odjel': value_3
                },
                success: function (data) {
                    $("#id_res_person_1").html(data);
                }
            });

        });
    </script>

Console.log is added to track what is going on. When I click on the field in Chrome, dropdown opens and loads with data, first console.log. Then I select what I want. Done. So only 1 console.log in total.

When I click on the field in Firefox, on first press I get console.log, and I get second when I select. How can I prevent second mousedown when selecting data in dropdown in Firefox?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If it'a dropdown (select tag), you can try onchange event instead of mousedown. May be mousedown work differently in firefox compared to chrome.

You can refer to this link - Link

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!