GeekArticles
Database
SQL Server
Database
SQL ServerFocusing and Selecting the Text in ASP.NET TextBox Controls
<p>
When a browser displays the HTML sent from a web server it parses the received markup into a Document Object Model, or DOM, which models the markup as a hierarchical structure.
Each element in the markup - the <code><form></code> element, <code><div></code> elements, <code><p></code> elements, <code><input></code>
elements, and so on - are represented as a node in the DOM and can be programmatically accessed from client-side script. more, the nodes that make up the DOM
have functions that can be called to perform certain behaviors; what functions are available depend on what type of element the node represents.
</p><p>
One function common to most all node types is <code>focus</code>, which gives keyboard focus to the corresponding element. The <code>focus</code> function is commonly
used in data entry forms, search pages, and login screens to put the keyboard cursor in a particular textbox when the web page loads so that the user can start
typing in his search query or username without having to first click the textbox with his mouse. Another useful function is <code>select</code>, which is available for
<code><input></code> and <code><textarea></code> elements and selects the contents of the textbox.
</p><p>
This article shows how to call an HTML <code>focus</code> and <code>select</code> functions. look at calling these functions directly from client-side
script as well as how to call these functions from server-side code. Read on to learn more!
<br /><a More ></a></p>
Sponsored Links
Related Topics
Subscribe via RSS
SQL Server
- Naming Database Objects: Part II
- Trace Messages Part V: Trace Cleanup
- Naming Database Objects: Part I
- Multiple-Child Aggregation
- Creating SQL Tables for an Integrating Application Using Dexterity
- SQL Server 2005 Beta 2 Transact-SQL Enhancements
- .NET Rocks! - Brian Larson on SQL Server Reporting Services
- Computing the Trimmed Mean in SQL
- SQL Server 2000 Gains on Oracle
- Separator First Formatting (SFF)
