SUBROUTINE FORMHF
*Display a simple form, with name and address fields and an
*Image button to submit the form

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

* Get the URL of the Reality item server
IMAGE = ""
CALL RW_GET_PARAM("__isurl", IMAGE)
* Specify the location of the image
IMAGE = IMAGE : "/REALWEB-ITEMS/books.gif"

* Start the HTML page
CALL RW_START_HTML_PAGE("Name and Address Details", "", "", "", "")
CALL RW_PUT("Enter your name and address, then click on the books to continue")
CALL RW_NEWLINES(2)

* Start the HTML form, specifying that the subroutine FORMHF2
* should be run when the form is submitted

CALL RW_START_HTML_FORM("FORMHF2", "NAMEFORM", "")

* Create the editboxes
CALL RW_START_PARA("", "")
CALL RW_PUT("Name:     ")
CALL RW_EDIT_BOX("NAME", 30,"")
CALL RW_END_PARA
CALL RW_START_PARA("", "")
CALL RW_PUT("Address: ")
CALL RW_EDIT_BOX("ADD1", 30,"")
CALL RW_END_PARA
CALL RW_START_PARA("", "")
CALL RW_PUT("      ")
CALL RW_PUT("      ")
CALL RW_EDIT_BOX("ADD2", 30,"")
CALL RW_END_PARA
CALL RW_START_PARA("", "")
CALL RW_PUT("      ")
CALL RW_PUT("      ")
CALL RW_EDIT_BOX("ADD3", 30,"")
CALL RW_END_PARA
CALL RW_START_PARA("","")
CALL RW_PUT("Postcode:   ")
CALL RW_EDIT_BOX("PCODE", 7,"")
CALL RW_END_PARA

* Create the image button
CALL RW_IMAGE_BUTTON("BOOKS", "Reader Details", IMAGE, "")

* Complete the form
CALL RW_END_FORM
* Complete the page
CALL RW_END_PAGE
RETURN
SUBROUTINE FORMHF2
*Request further information from reader who supplied name & address

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

*Start the HTML page
CALL RW_START_HTML_PAGE("Reader Details", "", "", "", "")

*Get the name and address from the initial form
CALL RW_GET_PARAM("NAME",NAME)
CALL RW_GET_PARAM("ADD1", ADD1)
CALL RW_GET_PARAM("ADD2", ADD2)
CALL RW_GET_PARAM("ADD3", ADD3)
CALL RW_GET_PARAM("PCODE",PCODE)

*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>="Crime and Thrillers"
VALUE<2>="Historical"
VALUE<3>="Classics"
VALUE<4>="Science Fiction"

CALL RW_PUT("Now select your preferred type of fiction from the list")
CALL RW_NEWLINES(3)

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

*Put the name and address into hidden fields
CALL RW_HIDDEN("READERNAME", NAME, "")
CALL RW_HIDDEN("READERADD1", ADD1, "")
CALL RW_HIDDEN("READERADD2", ADD2, "")
CALL RW_HIDDEN("READERADD3", ADD3, "")
CALL RW_HIDDEN("READERPCODE", PCODE, "")

*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
SUBROUTINE HFCONFIRM
*Confirm information supplied on the previous two forms

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

*Start the HTML page
CALL RW_START_HTML_PAGE("Reader Details", "", "", "", "")

*Get the name and address entered on the first form
*(submitted as hidden fields with the second form)
CALL RW_GET_PARAM("READERNAME", READERNAME)
CALL RW_GET_PARAM("READERADD1", READERADD1)
CALL RW_GET_PARAM("READERADD2", READERADD2)
CALL RW_GET_PARAM("READERADD3", READERADD3)
CALL RW_GET_PARAM("READERPCODE",READERPCODE)

*Get the type of fiction selected from the list
CALL RW_GET_PARAM("LIST1", FICTION)

CALL RW_PUT("You have supplied the following details:")
CALL RW_NEWLINES(2)
CALL RW_PUT(READERNAME)
CALL RW_NEWLINE
CALL RW_PUT(READERADD1)
CALL RW_NEWLINE
CALL RW_PUT(READERADD2)
CALL RW_NEWLINE
CALL RW_PUT(READERADD3)
CALL RW_NEWLINE
CALL RW_PUT(READERPCODE)
CALL RW_NEWLINES(2)
CALL RW_PUT("Preferred type of fiction:")
CALL RW_NEWLINE
CALL RW_PUT(FICTION)
* Complete the page
CALL RW_END_PAGE
RETURN
ClosedResult
ClosedHTML