SUBROUTINE FORM4
*Display a simple form, requesting entry of a name in a single editbox
*followed by a single selection from a select list

*Include the RealWeb definitions
INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP

EQU AM TO CHAR(254)
EQU VM TO CHAR(253)

* Start the HTML page
* Display the text 'Select List' in the browser's title bar
CALL RW_START_HTML_PAGE("Select List", "", "", "", "")

*Set up the lists of descriptions and values for the select list
VALUE_TEXT=""
VALUE_TEXT<1>="Crime and Thrillers"
VALUE_TEXT<2>="Historical"
VALUE_TEXT<3>="Classics"
VALUE_TEXT<4>="Science Fiction"
VALUE=""
VALUE<1>="CR"
VALUE<2>="HI"
VALUE<3>="CL"
VALUE<4>="SF"

*Start the HTML form, specifying that the subroutine THANKS should be run when the submit button is clicked
CALL RW_START_HTML_FORM("THANKS", "FORM4", "")

BUF="Enter your name in the box, then select your preferred type of fiction and click Go"
CALL RWA_NEWLINES(BUF, 3)

CALL RWA_EDIT_BOX(BUF, "EDITBOX", 30, "3")
CALL RWA_NEWLINES(BUF, 4)

*Create the select list
CALL RWA_SELECT_LIST(BUF, "LIST1", VALUE_TEXT, VALUE, "", "")

*Create the submit button
CALL RWA_SUBMIT_BUTTON(BUF, "GO", "")

*Display the form
CALL RW_PUT(BUF)

*Complete the form
CALL RW_END_FORM

* Complete the page
CALL RW_END_PAGE
RETURN
Result
HTML