[showif Comparison]Show This HTML[/showif]Displays HTML conditionally only if the comparison is true.
[showif [username]=Grant]You're allowed in![/showif]
Comparisons are always case-insensitive so "grant" equals "GRANT".
|equal||=||[showif [username]=SAGEHEN]Welcome Mr. Sagehen[/showif]|
|not equal||!||[showif [random]!45]...[/showif]|
|begins with||~||[showif [ipaddress]~245.078.013]...[/showif].|
Notice the IP address has been typed with 3 digits in each portion of the address. This is very important for making these comparisons work as expected.
|less than||<||[showif [random]<50]...[/showif]|
|greater than||>||[showif [lastrandom]>25]...[/showif]|
|divisible by||\||[ShowIf [index]\3]...[/ShowIf]|
if both side of the equation are numbers, then the comparison for greater than, less than, and equals is performed numerically. If either side is not a number, then the comparison is performed alphabetically.
[showif I'm Friendly! Are you?=[question]]...[/showif ]
Welcome Macintosh User!
<tr class=rowcolor[showif [index]\2]alt[/showif]><td>[name]</td><td>[email]</td></tr>
(WebDNA code to process the form)
<b>Thank you for contacting us!</b>
Please use this form to contact us.
<form method=post action="[thisurl]">
(Contact form here, including the following tag)
<input type=hidden name=formsubmitted value=t>
A really useful way of blanking out the value of a text variable if it wasn't set (for whatever the reason) is shown in the example below. You HAVE to [url] your showif comparisons for ANY user enterable text to prevent user entered ampersands (&) and exclamation points (!) from improperly influencing the result.
This hint applies to the [hideif] context as well.
DOWNLOAD WEBDNA NOW!
Amazon Web Services (AWS) README for Machine Image ID...WebDNA Modules
A list of the currently available modules...WebDNA reference
A list of all WebDNA instructions...Tips and Tricks
A list of user-submitted tips ...Technical Change History
This Technical Change History provides a reverse chronological list of WebDNA changes...WebDNA Libraries
A list of available libraries for WebDNA...
Performs a SQL statement on an ODBC data source...[xslt]
The [xslt] Context allows the WebDNA programmer to 'apply' an XSL style sheet to an XML document and thus 'transform' the XML data into any format the programmer desires (usually HTML)...[orderfile]
Displays the contents of a shopping cart...[cookie]
Cookies are a great way to remember visitors...[lineitems]
Loops through all the line items in an order file...[xmlnode]