Atlassian AJS set Caret to End of textarea

Lukáš Maruniak August 29, 2011

Hi,

Is there any way how to set caret position to the end of textarea ?

There must be some AJS javascript functions which can solve this, can anybody help me ??

Thx.

1 answer

1 accepted

2 votes
Answer accepted
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 29, 2011

Use this function.

except use AJS.$.fn instead of $.fn

Then you can use:

AJS.$("#description").selectRange(6,6)

to get the length of the field contents use:

AJS.$("#description").val().length

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events