Go Back   Velocity Reviews > General Computer Discussion > Software
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
Old 10-11-2007, 09:40 AM   #1
Default Put cursor at the end of input text


Hi,

I have an input text box in my javascript code. When an event is fired, I need to set the cursor at the end of the text in the input text box but when I call:

Code:
textBox.focus()

the cursor is put at the first char of the text.

Any idea is appreciated.


peace2007
peace2007 is offline   Reply With Quote
Old 10-17-2007, 11:41 AM   #2
gaurav_kant
Junior Member
 
Join Date: Sep 2007
Posts: 12
Default try this code


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>

<script type="text/javascript">

function fun(thisForm){
document.frm.txt2.value=" ";
document.frm.txt2.focus();
return true;
}
</script>



</head>
<body>
<form name="frm" action="">
First name &nbsp;&nbsp;<input type="text" name="txt1" tabindex="0"><br><br>
Last name &nbsp;&nbsp;<input type="text" name="txt2" size="10" onfocus="return fun(this)" tabindex="1" > <br>
<input type="submit" name="sum" tabindex="2">

</form>

</body>
</html>


gaurav_kant
gaurav_kant is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wonderful data input with web reporting tool freezea Software 0 09-09-2009 05:30 AM
Memories on TV 3 and Text alca11 Software 0 07-20-2006 09:32 PM
SONY DVD RW DW-G120A SOMETIMES FAILS...... atlantic965 DVD Video 0 06-18-2006 10:36 PM
Burn process failed - help! Log file posted for help troubleshooting Michael Mason DVD Video 1 08-16-2004 09:24 PM
DVD Recorder-DV input & Hard Drive ? Marion DVD Video 7 05-16-2004 06:31 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46