e.keyCode == 13 not working in Firefox
I need help with this issue in Firefox. I have inherited some older code that I need to get working in Firefox. See Below
function inputText(e) {
if ( window.event ) {
e = window.event;
}
if ( e.keyCode == 13 || e.which==13 ) {
str = checkSpecial( f1.itext.value );
HOL_Talk( avatar, background, voice, '', str );
f1.itext.value = "";
return false;
}
return true;
}
It looks like Firefox just refreshes the screen on hitting the enter key.
Any help would be very appreciated.
I have not had a problem with the following code in Firefox:
Code:
<input type="text" onchange="calculate()" size="5" name="hour2" onkeypress="var e=window.event; if(e && e.keyCode===13){this.onchange();}"/>
but I just noticed there are three equal signs, but in a brief test two worked as well.
The page is VCR.htm . If you check it out entering 500 tab 950 Enter works on IE9, FF5, and Crome.
What version of FF are you using?
My bad on this one
I was finally able to capture the error and found that Firefox (for some reason) does not recognize my form -->f1. I took the original coded form and put it in a div and for some reason it's not able to recognize it. This is the error message from Firebug, "f1 is not defined
str = checkSpecial( f1.itext.value );"
Anyway, thank for your time and effort I really appreciate it.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks