[ List Archives Home ] [ Thread index for 2007 ] [ Date index for 2007 ] [ Author index for 2007 ]


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
John-
This may not be the most desirable fix however you could consider
replacing the <!--{submit}--> token with the actual javascript inserted
by that token. I'm never a fan of replacing dynamic tokens with static
code but I believe it may be your only solution. You could then remove
the whole if statement in question. Make sure you also bring in the
code for the button: http://pastebin.com/f5e25a47 (also below my
signature). This should still allow the return key to submit the search
as long as the cursor is in the text box. Unfortunately I don't have
access at the moment to test this.

Alex Palilonis
Evelyn S. Field Library
Library Assistant
(908) 526-1200 x8901
apalilon at raritanval dot edu

>>>>>>>>Code<<<<<<<<
<script language="javascript">
function iiiDoSubmit_1() {
var name = "iiiFormHandle_1";
if (document.getElementById)
obj = document.getElementById(name);
else if (document.all)
obj = document.all[name];
else if (document.layers)
obj = document.layers[name];
obj.form.submit();
}
</script>
<input type="hidden" id="iiiFormHandle_1"/>
<a href="#" onClick="iiiDoSubmit_1();"><img src="/screens/submit.gif"
alt="Submit" border="0" class="button" /></a>

-----Original Message-----
From: innopac-bounces at innopacusers dot org
[mailto:innopac-bounces at innopacusers dot org] On Behalf Of John Wenzler
Sent: Wednesday, January 09, 2008 18:35
To: innopac at innopacusers dot org
Subject: [IUG] Meebo and WebPAC in Firefox

Hello,

I have a question that the JavaScript experts out there may be able
to answer. Our library is using meebo (www.meebo.com) for IM
reference, and we have been experimenting with adding the meebo
widget to WebPAC so that students can ask questions from a search page.

For testing I put a widget on our opacmenu page in staging:
http://opac.sfsu.edu:2082/search

It works fine in IE, but I am having a problem with FireFox on PCs.
The problem is that whenever you type an IM message and hit the
return key in FireFox, a search query gets sent to WebPAC, you get a
search results page, and you lose your IM session.

In looking at the JavaScript on the WebPAC search pages, we think
that we have identified the source of the problem, but we don't know
how to fix it. Our search pages have the following script, which gets
added with the <!--{submit}--> token:


<script language="javascript">
function iiiDoSubmit_1() {
var name = "iiiFormHandle_1";
if (document.getElementById)
obj = document.getElementById(name);
else if (document.all)
obj = document.all[name];
else if (document.layers)
obj = document.layers[name];
obj.form.submit();
}
if (document.layers)
document.captureEvents(Event.KEYDOWN);
document.onkeydown =
function (evt) {
var keyCode = evt ? (evt.which ? evt.which : evt.keyCode) :
event.keyCode;
if (keyCode == 13)
iiiDoSubmit_1(); };
</script>

We think that "if (keyCode == 13) iiiDoSubmit_1(); };" is submitting
a search whenever you hit the "return" key anywhere on the page.

Any suggestions for getting around this?

Thank you,
John Wenzler


************************************************************************
*******************************************
John Wenzler
Electronic Resources CoordinatorJ. Paul Leonard Library
San Francisco State University Library
Phone: (415) 405-0694
Fax: (415) 338-6940
http://www.library.sfsu.edu
************************************************************************
********************************************

"Not everything that can be counted counts, and not everything that
counts can be counted."

-- Albert Einstein

--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
--
This message was distributed through the Innovative Users Group INNOPAC
list
Public replies: INNOPAC at innopacusers dot org
Update your subscription options:
http://innopacusers.org/mailman/listinfo/innopac