Forms. How to make select and chosen lists with categories (optgroup)

To do this you must specify the name of the parent label for each select element

select ' Not selected '  Text,  0 Value, 0 Selected, '  '  OptGroup
select title Text, id Value, 0 Selected, cast(len(title) as nvarchar) OptGroup from as_mt_metrics
order by OptGroup, Text

It is very important that the sorting is by OptGroup  and the first element must have a non-empty optGroup

Falcon Space is a functional web development platform on a narrow stack MS SQL/Bootstrap. Falcon Space Gettting started

SQL-tool for creating personal accounts on the site

The essence of the approach and the history of the creation of Falcon Space
Web platform for creating personal accounts

Falcon Space Platform

This is a reduction in the cost of ownership

at the expense of fewer people to support

This is a quick change

while using the program

This is a modern interface

full adaptation for mobile devices

MS SQL web applications. Affiliate program for developers and web studios

You can develop on your own or collaborate with us on Falcon Space web development using only SQL and HTML.
See examples with SQL code
Platform documentation
Working on MS SQL Server