583Chapter 25 .Text-Related Form Objects Syntax See Text (Professional web hosting)

583Chapter 25 .Text-Related Form Objects Syntax See Text Input Object. About this object A hidden object is a simple string holder within a form object whose contents are not visible to the user of your Web page. Despite the long list of properties, methods, and event handlers that this input element type inherits by virtue of being an input element, you will be doing little with a hidden element beyond read ing and writing its value property. The hidden object plays a vital role in applications that rely on CGI programs on the server. Very often, the server has data that it needs to convey to itself the next time the client makes a submission (for example, a user ID captured at the applica tion s login page). A CGI program can generate an HTML page with the necessary data hidden from the user but located in a field transmitted to the server at submit time. Along the same lines, a page for a server application may present a user-friendly interface that makes data-entry easy for the user. But on the server end, the database or other application requires that the data be in a more esoteric format. A script located in the page generated for the user can use the onSubmitevent han dler to perform the last minute assembly of user-friendly data into database- friendly data in a hidden field. When the CGI program receives the request from the client, it passes along the hidden field value to the database. I am not a fan of the hidden object for use on client-side-only JavaScript applica tions. If I want to deliver with my JavaScript-enabled pages some default data col lections or values, I do so in JavaScript variables and arrays as part of the script. Because scripted changes to the contents of a hidden field are fragile (for exam ple, a soft reload erases the changes), the only place you should consider making such changes is in the same script that submits a form to a CGI program or in a function triggered by an onSubmit event handler. In effect, you re just using the hid den fields as holding pens for the scripted data to be submitted. For more persis tent storage, use the document.cookie property or genuine text fields in hidden frames, even if just for the duration of the visit to the page. For information about the properties of the hidden object, consult the earlier listing for the text input object. The typeproperty for this object returns hidden. TEXTAREA Element Object For HTML element properties, methods, and event handlers, see Chapter 15. Properties Methods Event Handlers cols createTextRange() onAfterUpdate form select() onBeforeUpdate name onChange readOnly onErrorUpdate Continued TEXTAREA
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.

Leave a Reply