Availability: |
| |||||||
Inherits from: | Input object | |||||||
JavaScript syntax: | - | myPassword = myDocument.aFormName.anElementName | ||||||
- | myPassword = myDocument.aFormName.elements[anItemIndex] | |||||||
IE | myPassword = myDocument.all.anElementID | |||||||
IE | myPassword = myDocument.all.tags("INPUT")[anIndex] | |||||||
IE | myPassword = myDocument.all[aName] | |||||||
- | myPassword = myDocument.forms[aFormIndex].anElementName | |||||||
- | myPassword = myDocument.forms[aFormIndex].elements[anItemIndex] | |||||||
- | myPassword = myDocument.getElementByID(anElementID) | |||||||
- | myPassword = myDocument.getElementsByName(aName)[anIndex] | |||||||
- | myPassword = myDocument.getElementsByTagName("INPUT")[anIndex] | |||||||
HTML syntax: | <INPUT TYPE="password"> | |||||||
Argument list: | anIndex | A valid reference to an item in the collection | ||||||
aName | The name attribute of an element | |||||||
anElementID | The ID attribute of an element | |||||||
anItemIndex | A valid reference to an item in the collection | |||||||
aFormIndex | A reference to a particular form in the forms collection | |||||||
Object properties: | maxLength, readOnly, size, type, value | |||||||
Object methods: | handleEvent(), select() | |||||||
Event handlers: | onAfterUpdate, onBeforeUpdate, onBlur, onChange, onFilterChange, onFocus, onHelp, onKeyDown, onKeyPress, onKeyUp, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp, onResize, onRowEnter, onRowExit, onSelect, onSelectStart |
Many properties, methods and event handlers are inherited from the Input object class. Refer to topics grouped with the "Input" prefix for details of common functionality across all sub-classes of the Input object super-class.
Event handling support via properties containing function objects was added to Password objects at version 1.1 of JavaScript.
Some implementations will not allow JavaScript to read the password string that the user has entered. This is good. You might imagine otherwise on the grounds that you'd expect then that JavaScript then won't be able to validate the password. If you think about this for a minute you'll realize that View Source in a web browser exposes your entire security checking regime. Its actually quite sensible to disallow JavaScript from inspecting the password field. But then, all the user has to do is run different browser - one that does access the contents of the password field.
Realistically the validation of the password can only be done back at the server anyway and other than some simple range checking in the client end access to password values from JavaScript is of doubtful use.
Property | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
maxLength | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
readOnly | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ReadOnly. |
size | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
type | 1.1 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ReadOnly. |
value | 1.0 ![]() | 1.0 ![]() | 2.0 ![]() | 3.02 ![]() | 3.0 ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
Method | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
handleEvent() | 1.2 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
select() | 1.0 ![]() | 1.0 ![]() | 2.0 ![]() | 3.02 ![]() | 3.0 ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
Event name | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
onAfterUpdate | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
onBeforeUpdate | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
onBlur | 1.1 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
onChange | 1.0 ![]() | 3.0 ![]() | 2.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
onFilterChange | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
onFocus | 1.0 ![]() | 3.0 ![]() | 2.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
onHelp | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
onKeyDown | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onKeyPress | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onKeyUp | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onMouseDown | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onMouseMove | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onMouseOut | 1.1 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onMouseOver | 1.0 ![]() | 1.0 ![]() | 2.0 ![]() | 3.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onMouseUp | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onResize | 1.2 ![]() | 3.0 ![]() | 4.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
onRowEnter | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
onRowExit | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
onSelect | 1.0 ![]() | 3.0 ![]() | 2.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
onSelectStart | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
Prev | Home | Next |
parseInt() | Up | Password.handleEvent() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |