Marking the Content of a Textbox

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
dieter
Experienced User
Posts: 122
Joined: Tue May 22, 2012 6:45 am
First Name: Dieter
Last Name: Schröder
Company Name: Ecclesia Holding GmbH
State / Province: Outside Canada/USA
Country: Germany
Contact:

Marking the Content of a Textbox

Post by dieter »

Hello,
in a mask we have a textbox, which has an amount. The user probably wants to change the amount. To make it comfortable for the user we set the focus into the textbox. So the user can see the textbox with the amount and a blinking cursor in the textbox. If he wants to change the amount he has to delete the old amount and the to enter the new amount. So the user wishes that the amount should be marked (i don't know if this is the correct english word), so that he directly can overwrite the value.

Is there such a possibility?

Dieter
emhill
Experienced User
Posts: 116
Joined: Wed Sep 05, 2012 11:14 am
First Name: Eric
Last Name: Hill
Company Name: Integrated Corporate Solutions
Phone: 256-760-8239
Address 1: 501 S Wood Avenue
City: Florence
State / Province: Alabama
Zip / Postal Code: 35630
Country: United States
Contact:

Re: Marking the Content of a Textbox

Post by emhill »

Try this on the onfocus event for the text box:

this.select();

This will select/highlight the entire textbox so the user can just start keying over the existing data.

Hope this helps!
dieter
Experienced User
Posts: 122
Joined: Tue May 22, 2012 6:45 am
First Name: Dieter
Last Name: Schröder
Company Name: Ecclesia Holding GmbH
State / Province: Outside Canada/USA
Country: Germany
Contact:

Re: Marking the Content of a Textbox

Post by dieter »

Great!
Works perfect!
Thank you very much.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests