Closed Bug 160538 Opened 23 years ago Closed 23 years ago

Javascript-based popup menus don't always take

Categories

(Camino Graveyard :: HTML Form Controls, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 160158

People

(Reporter: adamrice, Assigned: saari)

Details

(Keywords: qawanted)

Attachments

(2 files)

This seems to be a pretty consistent problem, where some popup menus that call JS functions on mouseup fail to register. It's consistent in that the same popup menus consistently misbehave, but inconsistent in that some JS-based popup menus behave correctly. I see this when creating new albums at imagestation.com--there's a hierarchical pair of popup menus for categorizing and sub-categorizing albums. The first one works fine. The second one does not. I also see it with category menu on the Movable Type (see movabletype.org) "create new entry" bookmarklet, but not (oddly) with the normal editing page.
Adam, can you give us an example URL? Thx.
If you go to imagestation.com, create a new album (assuming you have an account...), and then attempt to assign categories and sub-categories to the album, you'll see this problem with the sub-category. Sorry I can't give you an easy URL, but I haven't noticed this anywhere that has an easy URL.
Adam, could you attach the HTML source of a page on which you observe this behavior? (Adding qawanted.)
Keywords: qawanted
Here's source code from the Movable Type bookmarklet I mentioned. I tried to paste in relevant page from imagestation.com, but that exceeds the 64 KB limit that bugzilla has on comments (!) ---- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <head> <meta NAME="description" CONTENT="MOVABLE TYPE: Personal Publishing System"> <title>MOVABLE TYPE :: Personal Publishing System</title> <link rel="stylesheet" href="/mt-static/styles.css" type="text/css"> <script language="JavaScript"> <!-- if ((!(navigator.appVersion.indexOf('MSIE') != -1) && (parseInt(navigator.appVersion)==4))) { document.write("<STYLE TYPE=\"text/css\">"); document.write("BODY { margin-top: -8px; margin-left: -8px; }"); document.write("</style>"); } var origWidth, origHeight; if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) { origWidth = innerWidth; origHeight = innerHeight; window.onresize = restore; } function restore () { if (innerWidth != origWidth || innerHeight != origHeight) location.reload(); } var c = new Array; if (c[5] == null) c[5] = new Array(); c[5][0] = new MTChoice('Business', 23); if (c[5] == null) c[5] = new Array(); c[5][1] = new MTChoice('Chemistry', 25); if (c[5] == null) c[5] = new Array(); c[5][2] = new MTChoice('Computing', 20); if (c[5] == null) c[5] = new Array(); c[5][3] = new MTChoice('Dictionaries', 16); if (c[5] == null) c[5] = new Array(); c[5][4] = new MTChoice('Display Technology', 30); if (c[5] == null) c[5] = new Array(); c[5][5] = new MTChoice('Industry', 27); if (c[5] == null) c[5] = new Array(); c[5][6] = new MTChoice('Japan General Interest', 32); if (c[5] == null) c[5] = new Array(); c[5][7] = new MTChoice('Japanese Culture', 31); if (c[5] == null) c[5] = new Array(); c[5][8] = new MTChoice('Japanese Government', 33); if (c[5] == null) c[5] = new Array(); c[5][9] = new MTChoice('Japanese Magazines', 38); if (c[5] == null) c[5] = new Array(); c[5][10] = new MTChoice('Japanese Newspapers', 37); if (c[5] == null) c[5] = new Array(); c[5][11] = new MTChoice('Japanese Publishers', 34); if (c[5] == null) c[5] = new Array(); c[5][12] = new MTChoice('Japanese Radio Broadcasters', 36); if (c[5] == null) c[5] = new Array(); c[5][13] = new MTChoice('Japanese TV Broadcasters', 35); if (c[5] == null) c[5] = new Array(); c[5][14] = new MTChoice('Law', 28); if (c[5] == null) c[5] = new Array(); c[5][15] = new MTChoice('Medical', 19); if (c[5] == null) c[5] = new Array(); c[5][16] = new MTChoice('Patents', 21); if (c[5] == null) c[5] = new Array(); c[5][17] = new MTChoice('People', 14); if (c[5] == null) c[5] = new Array(); c[5][18] = new MTChoice('Places', 15); if (c[5] == null) c[5] = new Array(); c[5][19] = new MTChoice('Quality Control', 26); if (c[5] == null) c[5] = new Array(); c[5][20] = new MTChoice('Search Engines', 13); if (c[5] == null) c[5] = new Array(); c[5][21] = new MTChoice('Securities, Banking, Finance, Insurance', 24); if (c[5] == null) c[5] = new Array(); c[5][22] = new MTChoice('Stylebooks, Quotations, etc', 18); if (c[5] == null) c[5] = new Array(); c[5][23] = new MTChoice('Telecoms', 22); if (c[5] == null) c[5] = new Array(); c[5][24] = new MTChoice('Translation', 17); if (c[5] == null) c[5] = new Array(); c[5][25] = new MTChoice('Zoology', 29); if (c[4] == null) c[4] = new Array(); c[4][0] = new MTChoice('computing', 10); if (c[4] == null) c[4] = new Array(); c[4][1] = new MTChoice('fire', 8); if (c[4] == null) c[4] = new Array(); c[4][2] = new MTChoice('fun', 12); if (c[4] == null) c[4] = new Array(); c[4][3] = new MTChoice('movies', 6); if (c[4] == null) c[4] = new Array(); c[4][4] = new MTChoice('music', 39); if (c[4] == null) c[4] = new Array(); c[4][5] = new MTChoice('news', 3); if (c[4] == null) c[4] = new Array(); c[4][6] = new MTChoice('personal', 4); if (c[4] == null) c[4] = new Array(); c[4][7] = new MTChoice('rides', 5); if (c[4] == null) c[4] = new Array(); c[4][8] = new MTChoice('tidbit', 11); if (c[4] == null) c[4] = new Array(); c[4][9] = new MTChoice('travel', 7); if (c[4] == null) c[4] = new Array(); c[4][10] = new MTChoice('weirdness', 9); function MTChoice (label, id) { this.label = label; this.id = id; } var d = new Array(); var cb = new Array(); var ap = new Array(); var ps = new Array(); d[3] = '1'; cb[3] = '1'; ap[3] = '0'; ps[3] = '1'; d[4] = '1'; cb[4] = '1'; ap[4] = '1'; ps[4] = '2'; d[5] = '1'; cb[5] = '1'; ap[5] = '1'; ps[5] = '2'; function setMenu (f) { var w = f.blog_id.options[f.blog_id.selectedIndex].value; if (ps[w] == 1) f.status.selectedIndex = 0; else f.status.selectedIndex = 1; var s = f.category_id; s.options[0] = new Option('Select', ''); s.length = 1; s.selectedIndex = 0; if (c[w] != null) { var m = c[w]; for (i=0; i<m.length; i++) s.options[i+1] = new Option(m[i].label, m[i].id); s.length = m.length + 1; } var s = f.allow_comments; if (d[w] != null) { var m = d[w]; s.checked = m == 1 ? true : false; } var s = f.convert_breaks; if (cb[w] != null) { var m = cb[w]; s.checked = m == 1 ? true : false; } var s = f.allow_pings; if (ap[w] != null) { var m = ap[w]; s.checked = m == 1 ? true : false; } } function validate (f) { var w = f.blog_id.options[f.blog_id.selectedIndex].value; if (w == '') { alert('You must choose a blog in which to post the new entry.'); return false; } return true; } function formatStr (v) { if (!document.selection) return; var str = document.selection.createRange().text; if (!str) return; document.selection.createRange().text = '<' + v + '>' + str + '</' + v + '>';} function insertLink () { if (!document.selection) return; var str = document.selection.createRange().text; if (!str) return; var my_link = prompt('Enter URL:', 'http://'); if (my_link != null) document.selection.createRange().text = '<a href="' + my_link + '">' + str + '</a>'; } function mtShortCuts () { if (event.ctrlKey != true) return; if (event.keyCode == 1) insertLink(); if (event.keyCode == 2) formatStr('b'); if (event.keyCode == 9) formatStr('i'); if (event.keyCode == 21) formatStr('u'); } //--> </script> </head> <body onkeypress="mtShortCuts()" class="pop"> <!-- Begin main content --> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="39"><img src="/mt-static/images/spacer.gif" width="39" height="50"></td> <td valign="top" width="350"><img src="/mt-static/images/spacer.gif" width="350" height="1"></td> </tr> <tr> <td width="39">&nbsp;</td> <td valign="top" width="350"> <form method="post" action="/cgi-bin/mt.cgi" onSubmit="return validate(this)"> <input type="hidden" name="is_bm" value="1"> <input type="hidden" name="author_id" value="1"> <input type="hidden" name="__mode" value="save_entry"> <input type="hidden" name="status_old" value=""> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td valign="top" width="175"><font class="title">Select a blog for this post:</font></td> <td valign="top" width="175"><font class="title">Status:</font></td> </tr> <tr> <td valign="top"><select name="blog_id" class="menu-short" onchange="setMenu(this.form)"> <option value="">Select a blog <option value="3">Jenny's Blog <option value="4">Random Neural Misfirings <option value="5">Honyaku Home Page </select></td> <td valign="top"><select name="status" class="menu-short"> <option value="1">Draft <option value="2" selected>Publish </select></td> </tr> <tr> <td colspan="2"><img src="/mt-static/images/spacer.gif" width="1" height="5"></td> </tr> <tr> <td valign="top" colspan="2"><font class="title">Title</font></td> </tr> <tr> <td valign="top" colspan="2"><input class="text-short" name="title" value=""></td> </tr> <tr> <td colspan="2"><img src="/mt-static/images/spacer.gif" width="1" height="5"></td> </tr> <tr> <td valign="top" colspan="2"><font class="title">Category</font></td> </tr> <tr> <td valign="top" colspan="2"> <select class="menu-long" name="category_id"> <option value="">Select </select> </td> </tr> <tr> <td colspan="2"><img src="/mt-static/images/spacer.gif" width="1" height="5"></td> </tr> <tr> <td valign="top" colspan="2"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td><input type="checkbox" name="allow_comments" value="1"></td> <td valign="top"><font class="title">Allow comments</font></td> </tr> </table> </td> </tr> <tr> <td colspan="2"><img src="/mt-static/images/spacer.gif" width="1" height="5"></td> </tr> <tr> <td valign="top" colspan="2"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td><input type="checkbox" name="convert_breaks" value="1"></td> <td valign="top"><font class="title">Convert Line Breaks</font></td> </tr> </table> </td> </tr> <tr> <td colspan="2"><img src="/mt-static/images/spacer.gif" width="1" height="5"></td> </tr> <tr> <td valign="top" colspan="2"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td><input type="checkbox" name="allow_pings" value="1"></td> <td valign="top"><font class="title">Allow pings</font></td> </tr> </table> </td> </tr> <tr> <td colspan="2"><img src="/mt-static/images/spacer.gif" width="1" height="5"></td> </tr> <tr> <td valign="top" colspan="2"> <table border="0" cellspacing="0" cellpadding="0" width="310" bgcolor="#F2F2F2"> <tr> <td width="212"><font class="title-padding-grey">Entry Body</font></td> <td width="98" align="right"> <script language="javascript"> if (document.selection) { document.write('<table border="0" cellspacing="0" cellpadding="0" width="107">'); document.write('<tr>'); document.write('<td width="24"><a href="javascript:formatStr(\'b\')"><img src="/mt-static/images/bold-button.gif" alt="bold" width="24" height="18" border="0"></a></td>'); document.write('<td width="24"><a href="javascript:formatStr(\'i\')"><img src="/mt-static/images/italic-button.gif" alt="italic" width="24" height="18" border="0"></a></td>'); document.write('<td width="24"><a href="javascript:formatStr(\'u\')"><img src="/mt-static/images/underline-button.gif" alt="underline" width="24" height="18" border="0"></a></td>'); document.write('<td width="26"><a href="javascript:insertLink()"><img src="/mt-static/images/url-button.gif" alt="link" width="26" height="18" border="0"></a></td>'); document.write('</tr>'); document.write('</table>'); } else { document.write('&nbsp;'); } </script> </td> </tr> <tr> <td colspan="2"><textarea cols="" name="text" class="short310" rows="14" wrap="virtual"><a href="http://bugzilla.mozilla.org/show_bug.cgi?id=160538">Bug 160538 - Javascript-based popup menus don't always take</a> </textarea></td> </tr> </table> </td> </tr> <tr> <td colspan="2"><img src="/mt-static/images/spacer.gif" width="1" height="5"></td> </tr> <tr> <td valign="top" colspan="2"><font class="title">Excerpt</font></td> </tr> <tr> <td colspan="2"><textarea cols="" name="excerpt" class="short310" rows="4" wrap="virtual"></textarea></td> </tr> <tr> <td colspan="2"><img src="/mt-static/images/spacer.gif" width="1" height="5"></td> </tr> <tr> <td colspan="2" align="right"><input class="button" type="button" onClick="window.close()" value="cancel">&nbsp;<input class="button" type="submit" value="post"></td> </tr> </table> </td> </tr> </table> </body> </html>
Similar to 160158?
Similar, zappiabj, although not identical. The interesting thing with the page cited in 160158 is that Alabama does get selected somehow, even though the initial state is "select your state" (and, interestingly, you can toggle between those two), whereas in the pathology that I have encountered, nothing gets selected--the menu stays in its pre-selected state (note the two different ways "state" gets used). Both might be symptoms of the same underlying problem, for all I know.
Adam, please *attach* the HTML source to the bug as a file, rather than quoting it in a comment. (Look for "Create a New Attachment.")
Sorry, wasn't aware of the attachment option. Here goes one. Check out the genre sub-category menu near the bottom.
Leaving qawanted; testcase needs minimization.
I think this IS a dup of bug #160158 Reason being (if you went to imagestation.com and made an account) at imagestation.com they're over writing window.document.form.select.option[0] making ALL the new options javascript created items. As opposed to bug #160158 's testcase where it doesn't overwrite the HTML created option ("Select a State") so you can still select the next item and only the next time.. Therefor... If javascript creates a list of options for a select you can only select HTML created options (ones that are part of the HTML) and only the first javascript created option Look at attachment #2 [details] [diff] [review] for a my cheesy rip off of bug #160158 's testcase Anyone object to this reasoning? If not should this comment also be apart of bug #160158? Also note... After selecting an option the select element still has focus. This will allow you to select options with your arrow keys(including the other javascript created options). Is this relavent to the bug/bugs?
yeah, this looks to be a dup --and the test case attached here works with 2002.08.28.05. *** This bug has been marked as a duplicate of 160158 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Component: General → HTML Form Controls
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: