Explain how you can work with radio buttons and check boxes.

What will be an ideal response?


Option or radio buttons are grouped by a common field name placed within thefollowing array:options[idref]whereoptionsis the common field name used by all the option buttons and idref iseither the index number or ID of the option button. For example, the first option buttonfor the protection field from the customer order form would have the following reference:document.forms.orderForm.elements.protection[0]?To determine which option button has been checked by the user, you have toexamine the checked property of each button. For example, the following code uses aforloop to go through each option button associated with the protection field, storingthe value of the selected option in the pCost variable, and breaking off theforlooponce the checked button has been located:var orderForm = document.forms.orderForm;var protection = orderForm.elements.protection;for (var i = 0; i < protection.length; i++) {if (protection[i].checked === true) {var pCost = protection[i].value;break;}}?Check box controls work the same way as option buttons in which thecheckedproperty indicates whether the box is checked and the value associated with achecked box is stored in thevalueproperty of the check box object. However, thisvalue is applied only when the check box is checked; otherwise there is no field valueassociated with the element.

Computer Science & Information Technology

You might also like to view...

Under the ____ rule, protection isn't adequate if any part of it can be exploited.

A. complete protection B. complete inspection C. complete coverage D. complete system

Computer Science & Information Technology

In an inheritance relationship, the class that does the inheriting is called the:

A. parent class B. base class C. virtual class D. derived class

Computer Science & Information Technology

If creating a simple and obvious form field label is not possible, then include a short paragraph that describes the information that should be entered into the field.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

____ consisted of machine languages, written in binary code and executed by the computer's processor.

A. First-generation languages B. Second-generation languages C. Third-generation languages D. Fourth-generation languages

Computer Science & Information Technology