Click to See Complete Forum and Search --> : code radio button


sodeb
02-27-2004, 03:52 PM
How can you program a radio or checkbox to display information on the form. This information will be printed within the form from the selected radio button.

example:
Car
Truck
Computer
If someone select the Truck, I would like the description of the truck to printout on the form next to the Truck selection and in another field on the form.

My knowledge of coding is ok. So please example the small things so I don't miss any steps.

Thank you!

olerag
02-27-2004, 09:38 PM
Using the object's onClick() or onChange() event will
initialize things. Altering another form object's properties
is accomplished (and is dependent) upon the property you
wish to adjust.

An example to place a checkbox value (whose object name
is "cb1") into a textfield (named "field1") can be accomplished
as..
if (document.forms[0].cb1.checked) {
document.forms[0].field1.value = document.forms[0].cb1.value;
}