399 users using DBSP now!
home -> documentation -> QRYLIST tag


Description

This element allows you to create the HTML code needed for the list of a combobox or listbox control based on a dataset. In addition, the element can initially select a specified text or value from the list.


Syntax

<#QRYLIST FIELDTEXT="AFIELDTEXT" FIELDVALUE="AFIELDVALUE" [SELECTEDTEXT="ASELECTEDTEXT" | SELECTEDVALUE="ASELECTEDVALUE"]>

FIELDTEXT This property defines the text values that will be diplayed on the control. The AFIELDTEXT value should be the field name from a dataset.
FIELDVALUE This property defines the values linked to the text values displayed on the control. This values are not visible. However, these values are sent when you put form send the information in a post operation. The AFIELDVALUE value should be a field contained in the dataset.
SELECTEDTEXT This property defines the item that will be initially selected. It can contain a literal value or an expression. Some item will be selected when his displayed text matches the value stored on this property.
SELECTEDVALUE This property defines the dropdownlist item that will be selected. The selected item is that one who FieldValue value is the same as the ASELECTEDVALUE value.

Considerations

In order to use the QRYLIST tag it have to be delimited by a DATASET tag. Due to the selectedtext and selectedvalue properties should be dataset's fields is necesary the DATASET declaration.


Applications

The dropdownlist is one of the most common controls that we found in web pages. So, the automation of some html code can help us to save time when we need to work with it.


Examples

Example 1. Setting a default value for the combobox

This example shows you how to select a specific value in a combobox.

Source code
Test example