SUBROUTINE HIDDEN
*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", "", "", "", "")
CALL RW_PUT("There is a wide range of holiday accommodation available in South Ayrshire")
CALL RW_NEWLINES(2)
CALL RW_PUT("Fill in your name and address details then check the relevant box(es) to request details")
CALL RW_NEWLINES(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 RW_HIDDEN("FORMID", "South Ayrshire", "")

* 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 checkboxes
CALL RW_CHECKBOX("accomtype","Hotels",0,0,"")
CALL RW_PUT("Hotels")
CALL RW_NEWLINE
CALL RW_CHECKBOX("accomtype","Bed and Breakfast",0,0,"")
CALL RW_PUT("Bed and Breakfast")
CALL RW_NEWLINE
CALL RW_CHECKBOX("accomtype","Self Catering",0,0,"")
CALL RW_PUT("Self Catering")
CALL RW_NEWLINE
CALL RW_CHECKBOX("accomtype","Camping",0,0,"")
CALL RW_PUT("Camping")
CALL RW_NEWLINES(2)

*Create a reset button
CALL RW_RESET("CLEAR","Clear Selections","")

*Create the submit button
CALL RW_SUBMIT_BUTTON("Submit Request","")

*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