SUBROUTINE HIDDENA
* Display a simple form, with name and address fields and checkboxes
* for the user to select the type of information required
* Include a form identifier as a hidden field

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

* Start the HTML page
CALL RW_START_HTML_PAGE("Holiday Accommodation in South Ayrshire", "", "", "", "")

BUF="There is a wide range of holiday accommodation available in South Ayrshire"
CALL RWA_NEWLINES(BUF, 2)
BUF=BUF:"Fill in your name and address details then check the relevant box(es) to request details"
CALL RWA_NEWLINES(BUF, 2)

* Start the HTML form, specifying that ACCOMDETAILS
* should be run when the form is submitted
CALL RW_START_HTML_FORM("ACCOMDETAILS", "SAREQUEST", "")

* Put the form identifier into a hidden field
CALL RWA_HIDDEN(BUF, "FORMID", "South Ayrshire", "")

* Create the editboxes
BUF=BUF:"Name:    "
CALL RWA_EDIT_BOX(BUF,"NAME", 30,"")
CALL RWA_NEWLINES(BUF,1)
BUF=BUF:"Address: "
CALL RWA_EDIT_BOX(BUF,"ADD1", 30,"")
CALL RWA_NEWLINES(BUF,1)
BUF=BUF:"       "
BUF=BUF:"       "
CALL RWA_EDIT_BOX(BUF,"ADD2", 30,"")
CALL RWA_NEWLINES(BUF,1)
BUF=BUF:"       "
BUF=BUF:"       "
CALL RWA_EDIT_BOX(BUF,"ADD3", 30,"")
CALL RWA_NEWLINES(BUF,1)
BUF=BUF:"Postcode:   "
CALL RWA_EDIT_BOX(BUF, "PCODE", 7, "")
CALL RWA_NEWLINES(BUF,2)

* Create the checkboxes
CALL RWA_CHECKBOX(BUF, "accomtype", "Hotels", 0, 0, "")
BUF= BUF: "Hotels"
CALL RWA_NEWLINES(BUF, 1)
CALL RWA_CHECKBOX(BUF, "accomtype", "Bed and Breakfast", 0, 0, "")
BUF= BUF: "Bed and Breakfast"
CALL RWA_NEWLINES(BUF, 1)
CALL RWA_CHECKBOX(BUF, "accomtype", "Self Catering", 0, 0, "")
BUF= BUF: "Self Catering"
CALL RWA_NEWLINES(BUF, 1)
CALL RWA_CHECKBOX(BUF, "accomtype", "Camping", 0, 0, "")
BUF= BUF: "Camping"
CALL RWA_NEWLINES(BUF, 2)

* Create a reset button
CALL RWA_RESET(BUF, "CLEAR", "Clear Selections", "")
* Create the submit button
CALL RWA_SUBMIT_BUTTON(BUF, "Submit Request","")

* Display the form
CALL RW_PUT(BUF)

* Complete the form
CALL RW_END_FORM
* Complete the page
CALL RW_END_PAGE
RETURN
SUBROUTINE ACCOMDETAILS
*Acknowledge request for details of holiday accommodation
*in a specific area of Scotland

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

EQU VM TO CHAR(253)

*Start the HTML page
CALL RW_START_HTML_PAGE("Request Acknowledgement", "", "", "", "")
*Get the name and address from the submitted 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)

*Get the form identifier - indicating the relevant area -
*which was submitted as a hidden field
CALL RW_GET_PARAM("FORMID", AREA)

CALL RW_PUT("Thank you for your interest in holiday accommodation in ")
CALL RW_PUT(AREA)
CALL RW_NEWLINES(2)

*Get the value of "accomtype" from the submitted form
*Multiple checkboxes may be have been selected, so the value returned
*will be a string of all selected modules separated by Value Marks
CALL RW_GET_PARAM("accomtype", TYPES)
IF TYPES NE "" THEN
TYPES2 = CHANGE(TYPES, VM, ", ")
CALL RW_PUT('We will send details of the following "':TYPES2:'" to ')
CALL RW_NEWLINE
CALL RW_PUT(NAME)
CALL RW_NEWLINE
CALL RW_PUT(ADD1)
CALL RW_NEWLINE
CALL RW_PUT(ADD2)
CALL RW_NEWLINE
CALL RW_PUT(ADD3)
CALL RW_NEWLINE
CALL RW_PUT(PCODE)
END

* Complete the page
CALL RW_END_PAGE
RETURN
ClosedResult
ClosedHTML