Populating a list box with database information
Ocassionally it is necessary to populate a form list box with dynamic content from a database.


 
Table Set-up
The data can come from any table. We'll use a simple one here for our example.
idname
1William Shakespeare
2Wolfgang Mozart
 
Example

 
Implementation

This could be done with both the iSQL tag or the iHTML tag. For this example, the iHTML tag is more efficient. The iHTML tag repeats it's OUTPUT field for each row of the table, so we can use this looping feature to our advantage. (this assumes that you understand how HTML form list boxes work) :

<FORM ACTION="nextpage.ihtml">
 <SELECT NAME=id>
  <iHTML SQL="SELECT id, name FROM [db table] ORDER BY name"
         OUTPUT="<OPTION VALUE=:1>:2">
 </SELECT>
</FORM>