Present Lists Using the SELECT Control

Present Lists Using the SELECT Control

You can use the SELECT control to present a predefined list to the user. The SELECT control is useful for quickly selecting one or more items from a predefined or dynamically generated list from the database. You can implement the SELECT control in different ways, including a drop-down list, a list box, or a multi-select list box. These use a combination of SIZE and MULTIPLE attributes.

To populate the control, you use the OPTION object. To get hold of the selected value(s), you need the reference of the control and the selected option. To retrieve the selected value, you use the SelectedIndex property with the options collection to identify the particular item.

In order to retrieve the selected values from a multi-select list, you need to iterate through all the options. The selected property can be queried to determine if the option is selected. If so, you can use the current index of the iteration to acquire the text or value of the item.

When a multi-select list is submitted, the items are sent as a comma-delimited list. If a VALUE attribute is not provided as an option, the TEXT attribute is sent instead.

Drop-down list

 SELECT ID="CityList">

List box

 SELECT ID="CityList" SIZE="2">

Multi-select list box

 SELECT ID="CityList" SIZE="3" MULTIPLE>
Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes

ransomware cyber attack

Why Is Ransomware Such a Major Threat?

One of the most significant cyber threats faced by modern organizations is a ransomware attack. Ransomware attacks have grown in both sophistication and frequency over the past few years, forcing