搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

firefox 4.0.1 - requires checking every checkbox on a web page before continuing

  • 18 回覆
  • 2 有這個問題
  • 16 次檢視
  • 最近回覆由 jscher2000

more options

Problem is at a contest website. After entering info on two screens, a 3rd screen comes up with a survey on it. One of the questions contains 19 checkboxes. Only one MUST be checked to continue on to the next screen. This worked properly in FF 3.6.1, but now in 4.0.1, I must check ALL 19 boxes before the website will proceed to the next page.

I have tested this on two PCs that have FF 4.0.1 and a third that still has FF 3.6.1. The other two PCs are both Windows XP. The problem exists on the two PCs with FF 4.0.1 and NOT on the one with FF 3.6.1.

I also have 4 profiles on all three computers. The problem happens on all 4 profiles.

I copy the places.sqlite file between the 4 profiles so the bookmarks stay current between all for profiles.


This is a portion of the webpage source:

<div id="q3" class="required"><label for="q3">
    <span class="q_sort">3. </span>When you purchase DVDs/Blu-Ray discs what movie genres are you most interested in?</label>
    <div id="q3-option-group" class="option-group">
  <input required type="checkbox" name="q3" value="a1"  />&nbsp;Action<br />

  <input required type="checkbox" name="q3" value="a2"  />&nbsp;Adventure<br />

  <input required type="checkbox" name="q3" value="a3"  />&nbsp;Animated<br />

由 asapReps 於 修改

所有回覆 (18)

more options

You probably noticed the word "required" in those <input> tags. I think earlier versions of Firefox ignored that attribute. If you want Firefox 4 to ignore that attribute, you could try turning off the HTML5 parser.

You can toggle HTML5 rendering off or back on again like this:

(1) Type or paste about:config in the address bar and press Enter. Click the button promising to be careful.

(2) In the filter box, type or paste html5 and pause while the list is filtered

(3) Double-click html5.parser.enable to toggle it to false or back to true.

Then reload the page.

Does that make any difference?

more options

Toggled html5 parser to false and back to true. No difference in response on the web page. It still requires ALL check boxes to be checked.

由 asapReps 於 修改

more options

That may be caused by the presences or required, supported by Firefox 4.

required (HTML5) This attribute specifies that the user must fill in a value before submitting a form. It cannot be used when the type attribute is hidden, image, or a button type (submit, reset, or button). The :optional and :required CSS pseudo-classes will be applied to the field as appropriate.
more options

You can remove those required attributes with a bookmarklet like this:


javascript:(function(){var e=document.getElementsByTagName("INPUT"),i; for(i=0;E=e[i];i++){if(E.hasAttribute("required")){E.removeAttribute("required")}}})();
more options

Procedures for implementing this bookmarklet code?

more options

You can test if it helps if you paste it in the location bar and click Go or press Enter while that page is on display in a tab.

You can create a bookmark and paste the code in the location field.


more options

Ok, while on the survey page, I copied the javascript code into the navigation toolbar address field, hit enter (saw no change to the page). Then clicked a few of the checkboxes, and the page accepted them and went to the next page. I was not required to check every box.

I guess now, the questions are is this is a FF 4.0.1 bug or a website bug, and what to do next? It's kind of a hassle having to copy the java code in each time, especially when I don't have to using I.E. or FF 3.6.1

more options

If you need to use that bookmarklet often then create a new bookmark on the bookmarks toolbar and paste the full javascript code in the location field for easy access.


I would assume that it is a problem with the code. I don't know why you would need a required attribute for a checkbox unless you want to confirm accepting something like an agreement or do not want an input field to be empty.


more options

Sorry for the delayed reply.

> Toggled html5 parser to false and back to true.

Test it with the parser set to false (reload page and test). If that doesn't help, then set it back to true.

more options

Remove the label tag of your html structure and try again. It worked for me.

more options

The site is not mine. I am only a visitor to the site.

more options

The only thing that has worked from an end-user point of view is the bookmarklet java code.

I guess I need to know how to report the issue as a bug to FF developers.

more options

Well, now that I have installed FF 6.0.1, the problem with checkboxes is back. The workaround javascript bookmarklet provided by cor-el no longer works. I have to check EVERY checkbox on the survey webpage before it will allow me to continue to the next page.

Any suggests this time? Any hope that a permanent fix will ever be issued?

And just fyi, this is NOT my website, it is an eprize website. I have NO control over it.

(This is the javascript code I was pasting into the address field) javascript:(function(){var e=document.getElementsByTagName("INPUT"),i; for(i=0;E=e[i];i++){if(E.hasAttribute("required")){E.removeAttribute("required")}}})();

more options

You can no longer run JavaScript code via the location bar in Firefox 6 and later.
You can see an error message in the Tools > Error Console.
That code now gets a null principal for security reasons and thus doesn't have any effect (Bug 656433).
You need to create a (keyword) bookmarklet and run the code by invoking that bookmark.

NoScript can allow you to run such code via the location bar, see:

more options

I am not sure I have created a bookmark correctly. I first created a fix.html file, pasted the javascript code that cor-el provided into the file, saved it, then opened it and added it as a bookmark.

I tried dragging that bookmark onto the webpage, but it didn't help.

Then I went to properties of the bookmark from that file, pasted the javascript into the "location" field, and dragged that onto the webpage, but it didn't help either.

Then I deleted everything out of the file, leaving the javascript code still in the "location" field, but it still didn't help when dragged onto the webpage.

A s much as I dislike it, my only option is to use IE, which has NO problem with the web page.

more options

Sorry, I know this isn't obvious, but it's easier than you think.

To create a bookmarklet:

  1. Select the javascript code above and copy it to the clipboard
  2. Right-click the Bookmarks toolbar and choose New Bookmark
  3. Paste the javascript code as the location
  4. Enter a name, then click Add
more options

After creating a NEW bookmark from scratch with the javascript code in the "location" field does work as far as the checkbox issue. I tested the page by only checking a few checkboxes, got the message that I needed to check more, and all the unchecked checkboxes were highlighted. Then I clicked on the bookmark link, and the highlights were removed and I was able to "ok" the page and continue on.

So now the quesstion is do I need to submit a bug or how does the issue get pushed to the support people?

more options

So now the quesstion is do I need to submit a bug or how does the issue get pushed to the support people?

If each of the checkboxes still says it is required, then I'm not sure Firefox is doing anything wrong. I haven't visited the survey site, so I'm just guessing here, but maybe they have a script that manages the required attributes, and that script isn't working correctly in Firefox.

Can you flag up the problem with the operators of the survey site? I'm sure they would like to get accurate results!