Summary: | Duplicated <form id="show-bug" name="f" creates javascript error reported by debugger | ||
---|---|---|---|
Product: | [Websites] bugs.kde.org | Reporter: | Gérard Talbot (no longer involved) <browserbugs2> |
Component: | general | Assignee: | Matt Rogers <mattr> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Gérard Talbot (no longer involved)
2011-08-07 22:10:56 UTC
Firefox 5.0 returns the first form when multiple forms have the same name: " (...) document.forms['x'] looks for forms names 'x' and if there is more than one returns a list (not just the first one as we [Mozilla] do). " https://bugzilla.mozilla.org/show_bug.cgi?id=293397#c2 -------------- Expected Results: No javascript error modal window should pop up and no javascript error should be reported. By this, I mean the KDE Bug Tracking System entrance webpage should be fixed. There should not be 2 forms with the same name, otherwise a javascript error is the correct thing to report when trying to parse and execute document.forms['f'].quicksearch.focus(); -------------- Reduced testcase ================ http://www.gtalbot.org/BrowserBugsSection/Konqueror4Bugs/Bug279618-duplicated-form-with-same-name.html This testcase is mostly there to test/verify javascript debuggers, error console, query some values, compare results with other browsers. regards, Gérard KDE Platform Version: 4.7.0 Konqueror version: 4.7.0 (KHTML rendering engine) Qt Version: 4.7.2 Operating System: Linux 2.6.38-10-generic-pae i686 (32bits) Distribution: Kubuntu 11.04 here. regards, Gérard Can you reopen if this still happens now the bugzilla version has been updated? TypeError Null value at line 217 function quicksearchHelpText(el_id, action){ var el = document.getElementById(el_id); if ( action == "show") { if( el.value == "" ) { el.value = quicksearch_message YAHOO.util.Dom.addClass(el, "quicksearch_help_text"); } } else { if( el.value == quicksearch_message ) { el.value = ""; YAHOO.util.Dom.removeClass(el, "quicksearch_help_text"); } } } YAHOO.util.Event.onDOMReady(onLoadActions); //--> ------------ (In reply to comment #3) > Can you reopen if this still happens now the bugzilla version has been > updated? Tom Albers, The error in the bug report no longer happens but another one exists now. I may have to open another bug report for that one ... Gérard (In reply to comment #4) > TypeError Null value at line 217 > function quicksearchHelpText(el_id, action){ var el = document.getElementById(el_id); if ( action == "show") { line 217: if( el.value == "" ) { According to Konqueror's Javascript Debugger and the values of local variables, action is "show" el_id is "quicksearch_main" el is null the window's url is https://bugs.kde.org/index.cgi?GoAheadAndLogIn=1 So, the question is: Is there an element with the id attribute value of "quicksearch_main" in such window? Gérard (In reply to comment #5) > So, the question is: Is there an element with the id attribute value of > "quicksearch_main" in such window? As far as I can see, the error being reported by Konqueror Javascript Debugger is correct and appropriate: there is no element with id attribute value of "quicksearch_main". So, line 217 var el = document.getElementById(el_id); when the el_id value passed is "quicksearch_main" 2 other points. 1- I also wish that the javascript would be entirely declared in the head section and not into body. 2- The script could be improved too " Correct Reference To Form Input document.forms["formname"].elements["inputname"] Bad Practice document.formname.inputname " Javascript Best Practices Reference Forms and Form Elements Correctly http://www.javascripttoolbox.com/bestpractices/#forms Gérard |