theForm.lbreak[i].checked) {
break
}
}
In this example, lbreak is the name of the group of radio buttons on the parameter form, and the length
property tells you how many radio buttons are in the group. When the loop finds the selected radio button
in the array, the loop is broken, and the program proceeds to the next group of statements.
Unfortunately, after you know which radio button is checked, you have no easy way to get its value. The
Dreamweaver DOM doesn??™t support the value property for the radio input type. As a result, you have to
BC 19
Creating and Using Objects
assign the value to a variable based on which radio button was selected. You can complete this task in a
simple series of if-else statements:
if (i == 0){
val = ??????
} else {
if (i == 1) {
val = ???left???
} else {
if (i == 2) {
val = ???right???
} else {
val = ???all???
}
}
}
Alternatively, you can put all the values in an array and assign them in a statement like the following:
return ???
???
List boxes and drop-down menus
List boxes and drop-down menus are perfect for offering a variety of options in a compact format. Dropdown
menus enable the user to choose an option from a scrolling list; list boxes offer multiple choices from
a similar list.
Pages:
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890