680Part IIIDocument Objects Referenceyou can use the property (Make a web site)

680Part IIIDocument Objects Referenceyou can use the property reference. Therefore, assuming that your script doesn t know thename of the first object in the first form of a document, the statement isvar objectName = document.forms[0].elements[0].name; Related Items:form.elementsproperty; all other formelement objects nameproperty. readOnlyValue:Boolean.Read/WriteCompatibility:WinIE4+, MacIE4+, NN6+, Moz1+, Safari1+ To display text in a text field yet prevent users from modifying it, newer browsers offer thereadOnlyproperty (and tag attribute). When set to true, the property prevents users fromchanging or removing the content of the text field. Unlike a disabled text field, a read-only textfield looks just like an editable one. For older browsers, you can partially simulate this behavior by including the following eventhandler in the inputelement: onfocus= this.blur() The event handler approach is not foolproof, however, in that quick-fingered users may beable to change a field before the event handler completes its task. For NN4, you can also trapfor any keyboard events and prevent them from putting characters in the field. Use The Evaluator (Chapter 13) to set the bottom text box to be read-only. Begin by typinganything you want in the bottom text box. Then enter the following statement into the toptext box: document.forms[0].inspector.readOnly = true; While existing text in the box is selectable (and therefore can be copied into the clipboard), itcannot be modified or removed. Related Items:disabledproperty. sizeValue:Integer.Read/WriteCompatibility:WinIE4+, MacIE4+, NN6+, Moz1+, Safari1+ Unless otherwise directed, a text box is rendered to accommodate approximately 20 charac- ters of text for the font family and size assigned to the element s stylesheet. You can adjustthis under script control (in case the sizeattribute of the tag wasn t enough) via the sizeproperty, whose value is measured in characters (not pixels). Be forewarned, however, thatbrowsers don t always make completely accurate estimates of the space required to display aset number of characters. If you are setting the maxlengthattribute of a text box, making thesizeone or two characters larger is often a safe bet. Resize the bottom text box of The Evaluator (Chapter 13) by entering the following statementsinto the top text box: document.forms[0].inspector.size = 20; document.forms[0].inspector.size = 400; Reload the page to return the size back to normal (or set the value to 80). Related Items:maxLengthproperty. document.formObject.textObject.name
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.

Leave a Reply