Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to select text in TIWEdit
#1
Question 
Hello,

I would like to select text in a TIWEdit control as soon as the page is rendered.
I played a little with Javascript in ScriptEvent property without success.

How can I do it?

Thank you,
Davide
Reply
#2
Set the ActiveControl property on the page to that TIWEdit.
Reply
#3
(03-30-2022, 09:00 PM)kudzu Wrote: Set the ActiveControl property on the page to that TIWEdit.

Thank you for your quick suggestion.
Setting the ActiveControl focus the control but does not select the text.
I would like to focuse the control and select the contained text so the user can digit immediatly overwriting the default present in the control when the page is shown. 

Thank you,
Davide
Reply
#4
(03-31-2022, 12:32 PM)David1 Wrote:
(03-30-2022, 09:00 PM)kudzu Wrote: Set the ActiveControl property on the page to that TIWEdit.

Thank you for your quick suggestion.
Setting the ActiveControl focus the control but does not select the text.
I would like to focuse the control and select the contained text so the user can digit immediatly overwriting the default present in the control when the page is shown. 

Thank you,
Davide

ScriptEvents->onFocus
  EDTEXTFIELDIWCL.select();
  EDTEXTFIELDIWCL.style.backgroundColor="#00ff00";

even when your Textfield is edTextField - you must use Uppercase in Scripts for Intraweb-Controls
Reply
#5
We are introducing method SelectAll() to all IWEdit descendants and IWMemo descendants in the next release.
Reply
#6
(04-01-2022, 05:59 PM)kpenzkofer Wrote:
(03-31-2022, 12:32 PM)David1 Wrote:
(03-30-2022, 09:00 PM)kudzu Wrote: Set the ActiveControl property on the page to that TIWEdit.

Thank you for your quick suggestion.
Setting the ActiveControl focus the control but does not select the text.
I would like to focuse the control and select the contained text so the user can digit immediatly overwriting the default present in the control when the page is shown. 

Thank you,
Davide

ScriptEvents->onFocus
  EDTEXTFIELDIWCL.select();
  EDTEXTFIELDIWCL.style.backgroundColor="#00ff00";

even when your Textfield is edTextField - you must use Uppercase in Scripts for Intraweb-Controls

Thank you, it function as expected  Wink
Reply
#7
If you update to IW 15.2.52 you can use IWEdit.SelectAll method from your Delphi code now. :-)

https://www.atozed.com/2022/04/intraweb-15-2-52/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)