Custom Web Publishing Guide

Table Of Contents
110 Custom Web Publishing Guide
To avoid conversion problems resulting from the preceding example, change the CDML source code as
follows:
[FMP-If: currentdatabase.eq.Customers.fp5]
<input type="text" NAME="StateProvince" SIZE="16" VALUE="[FMP-Field:StateProvince]">
[FMP-Else]
<input type="text" NAME="StateProvince" SIZE="16" VALUE="">
[/FMP-If]
<SELECT NAME="-max">
[FMP-If:currentmax.eq.5]
<OPTION SELECTED>5 </OPTION>
[FMP-Else]
<OPTION>5 </OPTION>
[FMP-If:currentmax.eq.10]
<OPTION SELECTED>10 </OPTION>
[FMP-Else]
<OPTION>10 </OPTION>
[/FMP-If]
</SELECT>
1 The CDML Converter removes instances of the –format tag in a form and converts its value into an attribute
of the form tag. The result in the converted stylesheet is that there is one less input parameter in the form.
This may cause problems if your CDML solution uses JavaScript to refer to the form fields.
For example, the following form:
<FORM METHOD="POST" ACTION="FMPro" NAME="checkoutform">
<INPUT TYPE="hidden" NAME="-db" VALUE="Orders.FP5">
<INPUT TYPE="hidden" NAME="-format" VALUE="thanks.htm">
<INPUT TYPE="hidden" NAME="-lay" VALUE="CGI">
<INPUT TYPE="text" SIZE="50" NAME="Account Number">
</FORM>
is converted to these XSLT statements:
<form method="POST" name="checkoutform"><xsl:attribute name="action">thanks.xsl</xsl:attribute>
<input type="hidden" name="-db" value="Orders"/>
<input type="hidden" name="-lay" value="CGI"/>
<input type="text" size="50" name="Account Number"/>
</form>
The problem is that JavaScript is used to make sure that the user submits a value in the Account Number
field:
<P>
<CENTER>
<A HREF="javascript:document.checkoutform.elements[3].value == '' ?
alert('You must fill out the \'Account number\' field!') : document.checkoutform.submit()">
<IMG SRC="images/continue1.gif" NAME="cont" ALT="Continue"></A>
</CENTER>
</P>