5.1 Enter a Purchase Order (enterpo.nbt)

In the example below, for readability, some RES-Reach tags may span several lines on your browser page. This is not allowed in a real template file.

File: enterpo.nbt

Comments

<HTML>

This is ordinary HTML

< HEAD >

< TITLE >Enter a purchase order< /TITLE >

It should be called with

< /HEAD >

two parameters: Cust and PO

< BODY >

< H1 >Please enter your customer ID and PO number< /H1 >

The HTML for a form will be sent to the Browser.

< FORM ACTION={CALL_NBT} >

CALL_NBT is defined as a variable in the INI file: "reach.exe METHOD=POST". The Web server will fill in the CGI path and the rest of the URL.

Customer :

< IF VARIABLE="{Cust}" OPERATOR="NU" >

If Cust came in a valid numeric, then

< INPUT TYPE=text NAME="Cust" Value="{Cust}" > < BR >

pass its value to the next NBT file

< /IF >

< IF VARIABLE="{Cust}" OPERATOR="NN" >

If it’s not numeric or missing, then

< INPUT TYPE=text NAME="Cust" Value="1" > < BR >

pass the value "1" instead.

< /IF >

Of these 6 lines, only 1 is sent to the Browser.

Purchase order number :

< INPUT TYPE=text NAME="PO" Value="{PO}" >

Default PO to the value that came in.

< INPUT TYPE=hidden NAME="Qty" Value="0" > < BR >

Hidden field, used by ORDER.NBT

< INPUT TYPE=submit NAME=NBT VALUE="CATALOG" > < BR >

Neat trick: The submit button has the name NBT, so the value is both the button label and the name of the NBT file called.

< INPUT TYPE=submit NAME=NBT VALUE="ORDER" > < BR >

< /FORM >

more ordinary HTML

< HR >

< I >Thank you for using our on-line catalog. For other services, visit our

< A HREF="home.htm" >home page< /A >< /I >

< /BODY >

< /HTML >