Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9101071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:01:35+00:00 2026-06-17T01:01:35+00:00

Got a strange thing going on, really don’t have a idea how to solve

  • 0

Got a strange thing going on, really don’t have a idea how to solve this one. Neither did I find useful stuff when googleing.

I have a html form that includes this:

<label for="gebied">Gebieden</label>
<div class="button button-selected"><input type="checkbox" name="areas" value="nederland" checked="checked" />Nederland</div>
<div class="button button-selected"><input type="checkbox" name="areas" value="europa" checked="checked" />Europa</div>
<div class="button button-selected"><input type="checkbox" name="areas" value="wereld" checked="checked" />De Wereld</div>

Then with javascript (jQuery) I check which are checked and which are not:

var areas = [];
$('input[name=areas]:checked').each(function(){
areas.push($(this).val());
 });

This is called from within createShortUrl();, below in the relevant code:

$(function() {
    //Handle things when a buttons is clicked
    $("div.button").click(function() {
        //Find the input field for the clicked div
        var input = $(this).find(':input');
        var inputName = $(input).attr('name');
        //Handle checkboxes, which define the gebied
        if ($(input).is(':checkbox')) {
            //Change the classes
            input.prop('checked', !input[0].checked);
            $(this).toggleClass('button-selected');
        }
        //Handle radio
        if ($(input).is(':radio')) {
            $('form').find('input[name=' + inputName + ']').each(function() {
                $(this).parent('div').toggleClass('button-selected');
                $(this).prop('checked', !input[0].checked);
            });
        }
        //Clicking means something chanhes; create a new short url
        createShortUrl();
    });
}); 

The strange thing is that when in Firefox, when I have earlier checked some of them, they stay in the areas array. Even when I uncheck some of them, they stay in the array and vice versa. But when debugging in Safari, it works like a charm!

When I then uncheck every thing, the array is empty. Recheck some, and there in the array.

So, any ideas, what’s going on with Firefox? It looks like FF is caching, even after couple of times refreshing, the previous array. Despite my

var areas = []

in which I hoped to empty it and rebuild it….

It’s live at here, fired after the large button on the bottom is clicked.

Any thoughts are more then welcome!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T01:01:36+00:00Added an answer on June 17, 2026 at 1:01 am

    The issue is with your event handler. The problem is, the way you are modifying the state of the element does not work in Firefox. You should use attr() instead of prop() to change the checked state.

    Working code: Replaced .prop() with .attr().

    //Handle things when a buttons is clicked
    $("div.button").click(function() {
        console.log("Click");
    
        //Find the input field for the clicked div
        var input = $(this).find(':input');
        var inputName = $(input).attr('name');
    
        //Handle checkboxes, which define the gebied
        if ($(input).is(':checkbox')) {
            //Change the classes
            console.log("check");
            input.attr('checked', !input[0].checked);
            $(this).toggleClass('button-selected');
        }
    
        //Handle radio
        if ($(input).is(':radio')) {
            $('form').find('input[name=' + inputName + ']').each(function() {
                $(this).parent('div').toggleClass('button-selected');
                $(this).attr('checked', !input[0].checked);
            });
        }
        //Clicking means something chanhes; create a new short url
        createShortUrl();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a strange one going on here. Tried to implement is_wp_error in multiple
I need to do this rather strange thing, let's say i have: $number =
This is a really strange thing. I 'uploaded' (ie, copied to htdocs) a php
I got a strange exception when trying to find out if a property in
I got a strange problem. I have a tabcontrol and 3 tabs. On every
Has anyone seen this very strange behaviour before? I've got a solution whith 70
I've got quite a strange thing happening on an ASP.NET 4.0 web application using
I've got a strange problem with a try/catch block I'm using. I've got this
I have a function to send emails the strange thing is that its working
I have the method below to parse data from the twitter search, strange thing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.