Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am writing a application that sends SMS messages, the maximum number of characters that I can send is 612. I have two textboxes, charsLeft and messageNumber, into which I place the number of characters remaining, and the number of actual SMS messages that the users messages will be divided into.

 

I am using javascript to carry out my calculations using the onKeyUp event of the textarea, this means that the calculations are carried out everytime the user presses a key.

 

A problem arises if the user spots an error in their message and attempts to correct it. When they start typing in the middle of the message text, the first character will be displayed at the correct location, but the next character will be displayed at the end of the text in the textarea as the cursor hops to the very end after the text is typed.

 

Does anyone know of any control/technique that can allow me to stop this from happening.

 

Mike55.

A Client refers to the person who incurs the development cost.

A Customer refers to the person that pays to use the product.

------

My software never has bugs. It just develops random features. (Mosabama vbforums.com)

Posted
Why would the cursor jump to the end? The only thing I can take think is that when you populate the textboxes, focus is given to that textbox and then back to the textarea when the user starts typing. Instead of textboxes try using spans or divs to show the info.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...