0

How to selected all text in textbox by click ?

asked 2015-01-20 09:30:54 +0800

unitcell gravatar image unitcell
28 4

Hi all,

How to selected all text in textbox by click ? Dont wanna double click to select it.

Thanx.

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2015-01-20 09:56:54 +0800

dis gravatar image dis flag of Switzerland
140 4

Hi

use the select() method on InputElement (Textbox extends InputElement)

  • dis
link publish delete flag offensive edit
1

answered 2015-01-21 14:40:12 +0800

cyiannoulis gravatar image cyiannoulis
1201 10

updated 2015-01-21 16:26:33 +0800

You may use the select() method - as Dis said - directly inside your page:

<textbox onClick="self.select()" />

Or you may use native javascript if you like:

<textbox xmlns:w="client" w:onClick="javascript:this.select()" />

Costas

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2015-01-20 09:30:54 +0800

Seen: 29 times

Last updated: Jan 21 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More