?
Solved

I want my cursor to go at the end of the line of my textbox

Posted on 2003-02-27
2
Medium Priority
?
207 Views
Last Modified: 2012-05-04
I want my cursor to go at the end of the line of my textbox

im doing this but my cursor get at the first charaterand i want it to go at the end of them cause i do a onkeychange on that textbox
<body onload ="document.Emprunt.NoMateriel.focus()">

anyone that could help , it would be nice
0
Comment
Question by:ydery
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
cubrovic earned 200 total points
ID: 8035087
Litle trick will solve the problem


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script type="text/javascript">
<!--
function load() {
var el = document.forms.Emprunt.NoMaterial
var t = el.value
el.value = ""
el.focus()
el.value = t
}
// -->
</script>
</head>
<body onload ="load()">
<form name="Emprunt">
<input type="text" size="20" id="NoMaterial" value="aaa" />
</form>
</body>
</html>
0
 

Author Comment

by:ydery
ID: 8035780
tnx i understood what u meant , i tryed it with your text but i got some bugs

well i ended with this and now it works tnx a lot


function load()
{
     var temp = document.Emprunt.NoMateriel.value
     document.Emprunt.NoMateriel.focus()
     document.Emprunt.NoMateriel.value = temp
}
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question