By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,206 Members | 1,020 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,206 IT Pros & Developers. It's quick & easy.

keypress eventlistener in mozilla firebird

P: n/a
Hey y'all,

I'm using firebird 0.7 and developed some kind of inline editing with
java script. Therefore I used the keypress event listener. The problem
is that I can only enter one character then the "find as you type"
starts. You can disable it, of course, but what if someone else uses
the web page and hasn't disabled the feature? Do you have an idea how
to disable this feature with javascript? How can I get around this?

Thx for your help, dudes
Bye
Thomas (hope, this isn't silly? it works fine in netscape 7.1)
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a


Thomas wrote:
I'm using firebird 0.7 and developed some kind of inline editing with
java script. Therefore I used the keypress event listener. The problem
is that I can only enter one character then the "find as you type"
starts. You can disable it, of course, but what if someone else uses
the web page and hasn't disabled the feature? Do you have an idea how
to disable this feature with javascript? How can I get around this?


The DOM allows you to prevent the default action associated with an
event by calling
event.preventDefault()
and indeed with Firebird 0.7 in the following example no find as you
type happens as the event listener calls the above:

<html>
<head>
<title>keypress event listener and find as you type</title>
<script type="text/javascript">
if (document.addEventListener) {
document.addEventListener('keypress',
function (evt) {
var text = document.createTextNode(evt.type + ' with ' +
evt.charCode);
var p = document.createElement('p');
p.appendChild(text);
document.body.appendChild(p);
if (evt.preventDefault) {
evt.preventDefault();
}
},
false
);
}
</script>
</head>
<body>
<ul>
<li><a href="http://JavaScript.faqts.com/">JavaScript.FAQTs</a></li>
<li><a href="http://php.faqts.com/">PHP.FAQTs</a></li>
</ul>
</body>
</html>

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.