Text : Text Object « Form « JavaScript Tutorial

JavaScript Tutorial
1. Language Basics
2. Operators
3. Statement
4. Development
5. Number Data Type
6. String
7. Function
8. Global
9. Math
10. Form
11. Array
12. Date
13. Dialogs
14. Document
15. Event
16. Location
17. Navigator
18. Screen
19. Window
20. History
21. HTML Tags
22. Style
23. DOM Node
24. Drag Drop
25. Object Oriented
26. Regular Expressions
27. XML
28. GUI Components
29. Dojo toolkit
30. jQuery
31. Animation
32. MS JScript
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
JavaScript Tutorial » Form » Text Object 
10. 14. 1. Text

Instances are created by the browser when it encounters an HTML tag with the TYPE attribute set to text.

Event Handlers/Methods/PropertiesDescription
onBlurCalled when the text box loses the focus.
onChangeCalled when the text box loses the focus and has had its value modified.
onFocuswhen the text box receives the focus.
onSelectwhen a user selects some of the text within the text box.
blur()Removes the focus from the text box.
focus()Gives the focus to the text box.
handleEvent()Invokes the handler for the event specified and was added in JavaScript 1.2.
select()Selects the text in the text box.
defaultValueReturns the value of this text box specified by the VALUE attribute. Note that this property is not supported by the Opera browsers.
formReturns the entire form the text box is in.
nameReturns the name of this text box specified by the NAME attribute.
typeReturns the type of this text box specified by the TYPE attribute.
valueReturns the value that is actually displayed in the text box.


<html>
    <head>
    <script language="JavaScript">
    <!--
    function openWin(){
      var myInstance = document.myForm.myText;
      var myWin = open("""","width=450,height=200");

      myWin.document.write("The defaultValue is: " + myInstance.defaultValue);
      myWin.document.write("<br>");
      myWin.document.write("The name is: " + myInstance.name + "<br>");
      myWin.document.write("The type is: " + myInstance.type + "<br>");
      myWin.document.write("The value is: " + myInstance.value + "<br>");
      myWin.document.write(myInstance.form.myButton.value);
      myWin.document.close();
    }
    -->
    </script>
    </head>
    <body>
    <form name="myForm">
      <input type=TEXT value="hello world" name="myText">
      <input type=BUTTON value="Click to Process" name="myButton" onClick="openWin()">
    </form>
    </body>
    </html>
10. 14. Text Object
10. 14. 1. Text
10. 14. 2. Text.blur()
10. 14. 3. Text.defaultValue
10. 14. 4. Text.focus()
10. 14. 5. Text.form
10. 14. 6. Text.name
10. 14. 7. Text.onBlur
10. 14. 8. Text.onFocus
10. 14. 9. Text.onSelect
10. 14. 10. Text.select()
10. 14. 11. Text.type
10. 14. 12. Text.value
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.