On the main content search page (i.e., at /search/node), pressing the Enter key does not submit the search form in Internet Explorer -- instead, nothing happens at all (it acts just like the key was not touched).
This was discovered during the course of investigating http://drupal.org/node/194327 but it is a different bug and is not fixed by the patch there.
At least two of us experienced this bug with Internet Explorer (in my case with IE7).... although one person said it did not happen for them, so maybe it's only present in some versions of IE?
Also, the bug only appears when the Advanced Search fieldset is collapsed. If you open the Advanced Search fieldset, everything works fine. So it seems like fixing this would require "fooling" IE into seeing the whole form. Since the Enter key is literally ignored (i.e. the form is not submitted to the server at all), this can't be fixed with any post-processing on the server (as was done for the other bug listed above).
Any ideas?
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | IE_collapsible_bug.patch | 1.68 KB | theborg |
| #7 | ie_hidden_button_2.patch | 1.05 KB | David_Rothstein |
| #4 | ie_hidden_button.patch | 829 bytes | theborg |
Comments
Comment #1
scoutbaker commentedThis is a duplicate of another issue. I'm having a heck of a time finding it. Will update when I do.
Comment #2
scoutbaker commentedNever mind me. I'm sure now I was thinking of node/194327 that you referenced where you first mentioned this issue.
Comment #3
scoutbaker commentedI reproduced this on IE7 7.0.5730.13.
I also know why I was thinking this was a duplicate issue. I discovered it some time ago and was going to enter a report on it. Then I forgot.
One additional piece of information that may help. On a D5.6 site, I get no action from pressing the Enter key whether the Advanced search fieldset is collapsed or expanded. On D6, it only does this with the fieldset collapsed, as you reported.
Comment #4
theborg commentedWorkaround:
The advanced search button and the search button have the same function in this form.
In this patch I removed the advanced search button because we have the same functionality with the search button that already is there.
Comment #5
catchPersonally, I don't think I've ever clicked the advanced search button, I always use the normal search one, and this is where the keywords are. So I'd be quite happy to see it taken out.
Comment #6
dman commentedCould it be because the buttons have the same ID? Bad mojo. Or has that been fixed?
... just a random guess.
Comment #7
David_Rothstein commentedI tested the patch, and it works great -- fixes the problem in IE7 and continues to work fine in Firefox.
The attached patch is the same as above but I also changed the fieldset title from "Advanced search" to "Advanced search options" -- I think leaving it at "Advanced search" could be a bit confusing because the user might reasonably expect a submit button to be there when they open it?
Comment #8
David_Rothstein commentedAlso, following up on the comment by @catch, this patch has a nice UI improvement as a side effect to the bug fix:
With the submit button present, users tend to think the advanced search fieldset is its own separate form, so they might be surprised to find that their original keywords get appended to whatever they type in the advanced search area. This patch fixes that. (However, in my opinion the best UI would be one in which advanced search is its own separate form, automatically prepopulated with the original search keywords. But that sounds like a task for Drupal 7.)
Comment #9
scoutbaker commented@theborg - thanks for the patch. This seems to work as advertised.
@David_R - #7 is a good suggestion. I hope it makes it past the string freeze. #8 sounds like a great request for D7.
Comment #10
moshe weitzman commentedsomeone who has tested this should set to rtbc.
Comment #11
scoutbaker commentedI tested one more time and this patch is working correctly.
Edit:
My testing was simple:
Comment #12
gábor hojtsyWell, I am not sure we should fiddle with the user experience here. What about renaming the second submit button to "submit_advanced" or something?
Comment #13
David_Rothstein commentedHere is the current HTML.
Main search button:
<input type="submit" name="op" id="edit-submit" value="Search" class="form-submit" />Advanced search button:
<input type="submit" name="op" id="edit-submit-1" value="Advanced search" class="form-submit" />So it looks like the concern in #6 is not a problem -- the buttons already have unique IDs. In that case, I don't see how changing any of the names here could be expected to fix the bug?
Comment #14
gábor hojtsySo what's causing the problem after all?
Comment #15
catchLooks like the duplicate
name="op"to me.Comment #16
theborg commentedWell, that was difficult to find. I think that the problem is a bug with IE and collapse.js.
To test, disable javascript, or better set the fieldset to '#collapsible' => FALSE and the problem is gone, when you position the caret cursor over the search textbox the default button is not changing.
On my tests, if you add html to the fieldset including div.action, the bug reproduces. Also the effects slideUp and slideDown (that are changing properties) are also a cause for the bad behavior.
In this patch:
a) Exclude the buttons container (div.action) from the wrapper.
b) Only use hide() and show() effects with div.action when animating the fieldset.
Comment #17
theborg commentedPlease do test this patch with Opera and Safari.
Comment #18
catchTested this on IE7, FF2, Opera 9 and Safari 3. Worked fine for me on all, both the original bug, and the fieldset on the search page + cotnent-type settings form (which has some big fieldsets so seemed like a good candidate for breakage).
Will leave at needs review for a second set of eyes, but looks great.
Comment #19
David_Rothstein commentedNice job tracking this down! I tested with IE6, IE7, FF1.5, FF2, Safari 3, and Opera 9 and same results here -- everything works fine. Seems like this is RTBC.
Comment #20
gábor hojtsyThanks for the patch and for the extensive testing, committed.
Ps. may I ask you to hop over to http://drupal.org/node/214329 and help out with testing there if you have time? Thanks!
Comment #21
David_Rothstein commentedFollowing up on #8 and other discussion above, I filed a feature request for Drupal 7 to improve the advanced search interface: http://drupal.org/node/215735
Comment #22
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.