473,471 Members | 1,684 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

bring back cursor to editing position while editing the textarea in javasript

1 New Member
Expand|Select|Wrap|Line Numbers
  1.  
  2. function textCounter(field, countfield, maxlimit) {
  3.     if (field.value.length > maxlimit){ 
  4.           field.value = field.value.substring(0, maxlimit);
  5.     }
  6.     else { 
  7.           countfield = Number(maxlimit) - Number(field.value.length);
  8.     }
  9. }
  10.  
  11.  

I am using textarea that has limit of 50 characters. After i enter 50 characters,i put cursor in the middle of the text to edit the text entered.
The problem is When i enter one character, it takes that character and go at the end to delete the last character, it deletes it but stays there and doesnot come back to editing position.I want the cursor to remain at that position only and deletion to take place automatically from the end.

Please help with an answer asap. Thanks in advance.:)
Aug 3 '11 #1
0 1012

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Sam G | last post by:
Hi all, I have been wrestling with this problem all morning with no success so far where I have a need to bring back an excluded field. Basically I have a list of order numbers. Each order...
5
by: TimG | last post by:
I have a column that has 75 values, 50 are unique/25 are duplicates. I need to be able to bring back a list of the duplicates, listing all rows even if more than two have the same value. I need to...
2
by: Sylvain GENTIN | last post by:
Hi I try to bring back to exel a string computed by VB macro function. --------------------------------------------------------- Function CameoFilter(FileName As String, ByRef TextLine As...
1
by: maikins | last post by:
I am new to SQL Server 2005. We have a membership managment console using an SQL datatbase and I would like to find out how to write a query or several queries that would bring back instances where...
1
by: swethak | last post by:
Hi, How to do the bring front and bring back an images using javascript.
3
by: ReGenesis0 | last post by:
Is it possible to determine the caret position, in terms of x/y pixels, within a textarea? (I want to have a suggestion box pop up under where you're typing... so i need to determine where you are...
12
balabaster
by: balabaster | last post by:
How do I insert text into a textarea at the current cursor position in JavaScript?
3
by: ziycon | last post by:
I'm using the below function to add in a <br/> tag to the cusrors current position when the button is clicked, its adding in the <br/> at the begining everytime and not where the cursor is, I'm...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.