Atozed Forums
How to select text in TIWEdit - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: How to select text in TIWEdit (/thread-2692.html)



How to select text in TIWEdit - David1 - 03-30-2022

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


RE: How to select text in TIWEdit - kudzu - 03-30-2022

Set the ActiveControl property on the page to that TIWEdit.


RE: How to select text in TIWEdit - David1 - 03-31-2022

(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


RE: How to select text in TIWEdit - kpenzkofer - 04-01-2022

(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


RE: How to select text in TIWEdit - Alexandre Machado - 04-02-2022

We are introducing method SelectAll() to all IWEdit descendants and IWMemo descendants in the next release.


RE: How to select text in TIWEdit - David1 - 04-04-2022

(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


RE: How to select text in TIWEdit - Alexandre Machado - 04-05-2022

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/