SUBROUTINE FORM2
* 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 'Second Form' in the browser's title bar.
CALL RW_START_HTML_PAGE("Second Form", "", "", "", "")

* 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"

* Display the instructions for the form as a numbered list
CALL RW_START_OLIST("")
CALL RW_START_LIST_ITEM("")
CALL RW_PUT("Enter your name in the box")
CALL RW_END_LIST_ITEM
CALL RW_START_LIST_ITEM("")
CALL RW_PUT("Select your preferred type of fiction from the list")
CALL RW_END_LIST_ITEM
CALL RW_START_LIST_ITEM("")
CALL RW_PUT("Click the Go button")
CALL RW_END_LIST_ITEM
CALL RW_END_OLIST

*Start the HTML form, specifying that the subroutine THANKS should be run when the submit button is clicked
CALL RW_START_HTML_FORM("THANKS","FORM2","")
CALL RW_EDIT_BOX("EDITBOX",30,"3")
CALL RW_NEWLINES(4)

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

*Create the submit button
CALL RW_SUBMIT_BUTTON("GO","")

*Complete the form
CALL RW_END_FORM

* Complete the page.
CALL RW_END_PAGE

RETURN