Focus and Enter

M

Martin Rinehart

Does anyone have cross-browser focus and Enter key code?

I would like the applet in my previous post to get out of bed, the
cursor trailing the text in the tag box, the text not selected and an
Enter keypress in any box to be equivalent to clicking the Go button.
It works well, but doesn't do precisely what I want, in Chrome,
Firefox, Opera and Safari. (I refuse to waste my time on that other
Windows browser.)
 
S

SAM

Le 11/26/08 7:20 PM, Martin Rinehart a écrit :
Does anyone have cross-browser focus and Enter key code?

I would like the applet in my previous post to get out of bed, the

Which one of all your previous post ?
cursor trailing the text in the tag box, the text not selected and an
Enter keypress in any box to be equivalent to clicking the Go button.
It works well, but doesn't do precisely what I want,

And ?
What do you want ?
in Chrome, Firefox, Opera and Safari. (I refuse to waste my time
on that other Windows browser.)

It is not very difficult to replace the key Enter !
(once you decide to produce correct html code with form elements in a form)

<html>
<script type="text/javascript">
function go() {
var t = document.forms[0][0].value;
var r = document.getElementById('result');
r.innerHTML += '&lt;'+t+'>example&lt;/'+t+'>\n';
return false;
}
</script>
<form action="#" onsubmit="return go();">
<p>enter a tag : &lt;<input>&gt; and hit Enter key</p>
</form>
<pre id="result">
</pre>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top