...

View Full Version : controlling cursor focus



Kirl
06-04-2006, 06:27 PM
I'm trying to set the cursor focus in a form input type box called "userInput". How can i controll the cursor position?

I saw a similar thread below, but it's not quite the same and I didn't want to 'break in' as the problem wasn't quite resolved there...

Thanks.

Philip M
06-04-2006, 08:15 PM
You set the focus on a textbox using the focus() method. But you cannot control or change the position of the cursor within that textbox.

Kirl
06-04-2006, 11:56 PM
Thanks for the tip, I figured it out and my memory game is pretty much complete!

Please check it out here (http://www.kirl.nl/memorytest.html) and let me know what you think. Any possible improvements?

This is my first script wich serves an actual purpose, I'm pretty excited I got it to work in a reasonable time. As a sort of continuing scripting excersize I'm planning to add diffrent game modes etc.

Please let me know to what level you made it! :)

Arty Effem
06-05-2006, 02:56 AM
Thanks for the tip, I figured it out and my memory game is pretty much complete!

Please check it out here (http://www.kirl.nl/memorytest.html) and let me know what you think. Any possible improvements?
Having it work with the Mozilla series. Forms should not be referred to directly by name.
The easiest way to bandage what you have already, is to remove "onload=reset()" and at the end of the script insert this:

window.onload=function(){myForm=document.forms.myForm; reset();}

Kravvitz
06-05-2006, 03:19 AM
To add to what Arty Effem said, the object references to the form element are relying on the way that IE automatically adds all elements that have a name or id to the global vars.

Philip M, in some browsers you can control the cursor position. (http://www.codingforums.com/showthread.php?t=87984)

Philip M
06-05-2006, 08:29 AM
Philip M, in some browsers you can control the cursor position. (http://www.codingforums.com/showthread.php?t=87984)

Yes, but features that only work in some browsers are useless really. My policy is that if something does not work in IE5.5 (which many people still have) then it is not used. Only more sophisticated users have Mozilla and who apart from a geek has even heard of Opera?

Kravvitz
06-05-2006, 08:33 AM
Umm... it does work in IE5.5.

Kirl
06-05-2006, 10:40 AM
Thank you all for the help and suggestions, I apriciate it!

I haven't heard any levels though...


Only more sophisticated users have Mozilla and who apart from a geek has even heard of Opera?
Not sure if there are any game enthousiasts here (I'm a Nintendo nut (http://www.kirl.nl/picview_bign.html)). But Opera will be the standard browser for the new Nintendo system. Because of it's platform independant structure, or so the press release stated.

Is Opera any good?

Arty Effem
06-05-2006, 01:04 PM
Thank you all for the help and suggestions, I apriciate it!

I haven't heard any levels though...


Not sure if there are any game enthousiasts here (I'm a Nintendo nut (http://www.kirl.nl/picview_bign.html)). But Opera will be the standard browser for the new Nintendo system. Because of it's platform independant structure, or so the press release stated.

Is Opera any good?It is for JS developers. A popup console with meaningful error messages as standard, plus the ability to specify any code viewer/editor.
http://www.opera.com/download/



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum