Question

I am working on a page that accepts entry into a single textarea, then splits the contained text across two output textareas in realtime should it reach a certain character limit (the first with 0 - x characters, the second with x - end). I have the copying process working, but am at a loss on how to approach the division and have the first textbox stop accepting input while continuing real-time entry on the second one.

Was it helpful?

Solution

You could move the cursor between textboxes by using.

$('newTextBox').focus();

For the charater limit, use this.

<textarea maxlength="50">

</textarea> 

Note that it doesn't work on Internet Explorer 9 and earlier versions, or in Opera.

OTHER TIPS

I think you should be able to call .focus() on the second box to force the cursor into it

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top