Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2003-02-27
2
Medium Priority
?
209 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
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

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

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

A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…
Suggested Courses

579 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