// See if they have submitted or just need the form
if(request.method == "POST"){
// Store the number of selected options in a variable
var counter = getOptionValueCount("sports");
// Write the title
write('You selected the following options
');
// Iterate through the options and write which ones were selected
for(var i = 0; i < counter; i++){
// Get the Option.text values of the selected options
var optionValue = getOptionValue("sports", i)
write('Option ' + i + ': ' + optionValue + '
')
}
}else{
// If this page was called and a form was not submitted, then write the
// form to the page for the user to use.
write('');
}