EasyUI Forum
May 08, 2024, 06:35:39 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How can i insert text in Textbox  (Read 1246 times)
MSAG
Newbie
*
Posts: 41



View Profile Email
« on: January 24, 2023, 03:05:31 PM »

hi
How can i insert text in Textbox
in specific position
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: January 24, 2023, 06:36:13 PM »

Please try to use the editeditor extension instead. Call the 'insertContent' method to insert any html content into the current cursor position.

https://www.jeasyui.com/extension/texteditor.php
Logged
MSAG
Newbie
*
Posts: 41



View Profile Email
« Reply #2 on: January 25, 2023, 01:18:37 AM »

Thanks
but i dont want to use texteditor
if i use textbox not texteditor is there way to do that?

"Insert the text at the current cursor position in textbox"
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #3 on: January 27, 2023, 03:01:07 AM »

This code shows how to insert a string into the current position of a textbox component.
Code:
var t = $('#tt');
var start = t.textbox('getSelectionStart');
var s = t.textbox('getText');
s = s.slice(0,start) + 'new str' + s.slice(start);
t.textbox('setText', s);
Logged
MSAG
Newbie
*
Posts: 41



View Profile Email
« Reply #4 on: January 31, 2023, 03:00:43 AM »

thanks a lot Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!