Do you know how to simulate a submit by pressing the Enter key as opposed to clicking on a Submit button with version 2.02 Netscape (OS/2)? Yes.. that's what my users are actually using..for now..
Hmmm....could try adding an argument to each of your form objects:<br>
<i>onSubmit="document.</i>form name here<i>.submit();return true;"</i><br>
I'm not SURE if it'll work; but you could @ least give it a try <p>-Robherc<br><a href=mailto:robherc@netzero.net>robherc@netzero.net</a><br><a href= shared.freeservers.com/searchmaster.html>SearchMaster Interface...11-in-1</a><br>Wanting to learn Assembler; please e-mail me any tutorials or links for it that are useful to you
You're using very old technology if you're using Netscape V2. Time to upgrade.<br>
<br>
I'm not sure what version of Javascript Netscape V2.02 supports, but presuming Javascript 1.1, you can catch the enter key by trapping keydown events at the document level.<br>
<br>
Assuming that you've already checked to make sure it's Netscape:<br>
<br>
<head><br>
<script language=javascript><br>
function trapKeys(){<br>
document.captureEvents(Event.KEYPRESS);<br>
document.onkeypress=checkKey;<br>
return true;<br>
}<br>
<br>
function checkKey(EventObject) {<br>
var iKeyVal = eval(EventObject.which);<br>
<br>
if (iKeyVal==13) <br>
document.forms[0].submit();<br>
return true;<br>
}<br>
</script><br>
</head><br>
<body onload="trapKeys()"><br>
<br>
FORM CODE GOES HERE<br>
<br>
</body><br>
<br>
<br>
Note that this is from memory and there may be typos, but it should send you in the right direction.<br>
<br>
regards,<br>
-nick bulka<br>
Navigator 2.x supports JavaScript 1.0. JavaScript 1.0 does not support keyboard events so you cannot use that. The keyboard events were introduced in JS 1.2. Javascript 1.1 was introduced in NS 3.x, JS 1.2 with NS 4.0 to 4.05, JS 1.3 from NS 4.06 to present, with JS 1.4 expected in NS 5.0 [6.0?]. So I would recommend an upgrade to NS 4.06 or higher. But.....<br><br>JavaScript 1.0 does support onBlur, onFocus, onChange and onSubmit. Assuming the 'Tab' key actually tabs to the next field, you might be able to use the onBlur event in your text field to fire a submit with the 'Tab' key. But I don't think you're going to do it with the 'Enter' key.<br><br>The ONLY other way I can think of off the top of my head is to read the raw keyboard code (not the ASCII code) but you would need to do that with another language--more complex than you want to get. Not to mention, I don't know where to find a table of raw keyboard codes for IBM compatibles.
Actually, Netscape 2.02 for OS/2 is not the same as that version for Windows. It has JavaScript and all the other features of the v3.x Netscape for Windows. But Netscape 4.61 is available for OS/2. Why not use it?<br><br>DonP<br>(another OS/2 user)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.