|
 |
|
|
Integration with HTML
H2O is integrated with HTML forms. H2O variables automatically set values of HTML form components. For example, writing:
<<mystate="AK">> <select name=mystate> <option value="AL">Alabama <option value="AK">Alaska <option value="AR">Arkansas </select name=mystate>
brings up a pull-down menu with Alaska pre-selected. There is no need to use the HTML form tag "SELECTED" to set the default. Likewise, writing:
<input type=text NAME=myname size=15>
displays an input box containing the value of the variable myname. There is no need to set the VALUE in the form component. In H2O HTML form elements reflect the H2O variable environment. This features spans across all kinds of HTML form components.
Multi-page When variables are set in H2O their values are retained for the entire user-session. Let's say, for example, you write:
myheader="Page Header Here"
Then placing <<DISPLAY myheader /DISPLAY>> at the top of any page will display the value stored in myheader.
Name-Value Pairs Hypertext links can contain name-value pair that set values when clicked. For example, writing:
<A HREF=products.html NAME=SKU value=100>Quark Screwdriver</A>
sets the value of the variable SKU to 100 when Quark Screwdriver is clicked.
Submit Button Control The name of submit buttons, when clicked, are written to the variable HTMLOS.CLICKED. Consider the simple text editor:
<<myfile="/backend/file1.txt" COPY FILE=myfile TO mytext /COPY >> <HTML> File: <<myfile>>
<FORM METHOD=POST ACTION=EditFile> <INPUT TYPE=SUBMIT NAME=mySave VALUE="Save"> <INPUT TYPE=SUBMIT NAME=myReload VALUE="Reload"> <INPUT TYPE=SUBMIT NAME=myExit VALUE="Cancel/Exit"><BR> <TEXTAREA NAME=mytext COLS=65 ROWS=10></TEXTAREA> </FORM> </HTML> <<OVERLAY EditFile
IF HTMLOS.CLICKED="mySave" THEN COPY mytext TO FILE=myfile /COPY GOTO PAGE ELIF HTMLOS.CLICKED="myExit" THEN GOTO "login.html" ELIF HTMLOS.CLICKED="myReload" THEN GOTO PAGE /IF GOTO PAGE >>
|
|