Textbox value selection when widget gains focus

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
BFoster
Profound User
Posts: 50
Joined: Fri May 24, 2019 6:26 am
First Name: Ben
Last Name: Foster
Company Name: Manhattan Assurance Company
Contact:

Textbox value selection when widget gains focus

Post by BFoster »

I have a user requirement to allow selection of a field value to occur when the user clicks on the textbox widget.

I found this link that refers to two solutions. (See below) The first is the server-level solution (http://www.profoundlogic.com/docs/displ ... t+on+Focus) which would affect all fields on all applications and the second solution refers to "this.focus()" which would be a discrete field sort of solution. This did not work for me either.

Is the server-level solution (http://www.profoundlogic.com/docs/displ ... t+on+Focus) the only way to get the field value selected when the textbox widget gains focus? The goal here is to get the value selected for one field only as opposed to the server-level configuration that affects all fields.

The original post : https://core.profoundlogic.com/forum/vi ... ome#p10997
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Textbox value selection when widget gains focus

Post by Scott Klement »

Hi BFoster,

I'm not sure that I understand. You say that:
  • You can't use the "Highlight on Focus" feature because it affects all fields.
  • You can't use this.focus() because it affects only one field. But, then you say you want it for one field only.
Under what circumstance do you want it to be highlighted?

Also, I think the second option should be "this.select()" running in the "onfocus" event. That was probably a typo in the earlier thread.
BFoster
Profound User
Posts: 50
Joined: Fri May 24, 2019 6:26 am
First Name: Ben
Last Name: Foster
Company Name: Manhattan Assurance Company
Contact:

Re: Textbox value selection when widget gains focus

Post by BFoster »

The goal here is to get the value selected (getting highlighted in the process) for only one field as opposed to the server-level configuration that affects all fields and all applications.

The user simply wants to start typing over the existing value in the textbox after the widget gains focus. We would like to accomplish this without affecting all textboxes in all applications (via server-level config). We prefer to affect a single field on a particular screen.
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Textbox value selection when widget gains focus

Post by Scott Klement »

Set the text box's "onfocus" property to

Code: Select all

this.select();
If that won't work, then please explain better.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests