getOptionValueCount()

NES2+Syntax

getOptionValueCount(key)

Description

The getOptionValueCount function is a top-level function that is not associated with any object. This function returns the number of selected options passed to the function. The key parameter represents the NAME attribute of the <SELECT> tag on which you want to invoke the function.

Example

Listing 8.92 shows how to use the getOptionValueCount function to determine how many options were selected in a "sports" select box.

Listing 8.92 Using the getOptionValueCount Function
<SERVER>

// Store the number of selected options in a variable
var counter = getOptionValueCount("sports");

</SERVER>
						

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.