📄 034_field_types.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><!-- InstanceBegin template="/Templates/inside.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>PAGETITLE</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css/all.css" rel="stylesheet" type="text/css">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<script language="JavaScript" type="text/JavaScript">
if (self == top) { top.location.replace("index.html");
} else {
parent.window.frames.leftmiddle.location.reload(true);
}
</script>
</head>
<body bgcolor="#FFFFFF" background="images/bg_1200.gif" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><a name="top"></a><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="83%" height="29" bgcolor="#F8F8F8"><img src="images/delimiter.gif" width="19" height="29" border="0" align="absmiddle"><!-- InstanceBeginEditable name="path" -->DESCRIPTION<img src="images/bullet_3.gif" width="4" height="7" hspace="5" border="0"><span class="highlited">Field Types</span><!-- InstanceEndEditable --></td>
<td width="17%" height="29" align="right" bgcolor="#F8F8F8"><!-- InstanceBeginEditable name="navtop" -->
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#F8F8F8">
<tr>
<td width="19"><img src="images/delimiter.gif" width="19" height="29" border="0"></td>
<td width="34"><a href="033_local_form_configuration_file.html"><img src="images/nav_back.gif" alt="< back" width="34" height="7" border="0"></a></td>
<td width="21"><img src="images/delimiter_2b.gif" width="1" height="7" hspace="10" vspace="10" border="0"></td>
<td width="55"><a href="035_email_template.html"><img src="images/nav_forward.gif" alt="forward >" width="55" height="7" border="0"></a></td>
<td width="19"><img src="images/1x1.gif" width="19" height="29" border="0"></td>
</tr>
</table>
<!-- InstanceEndEditable --></td>
</tr>
<tr>
<td colspan="2" bgcolor="#CECECE" height="1"><img src="images/1x1.gif" width="1" height="1" border="0"></td>
</tr>
<tr valign="top">
<td height="80%" colspan="2"><table width="100%" border="0" cellspacing="15" cellpadding="0">
<tr>
<td><!-- InstanceBeginEditable name="content" --><span class="highlitedtitle">Field Types</span><br><br><span class="hhblue">1. General Description</span><br>
Form Processor Pro 4.0 allows you to create customized data fields, using Form Processor Pro pre-defined field types and calculation fields.
<ul>
<li>To insert a field into form, simply place chosen name using standard form elements, e.g.: <br>
<em><input type=”text” name=”FirstName”></em>,</li>
<li>Wherever you want to output field data, simply put in into square brackets, e.g.:<br>
<em>Dear [FirstName] ! Thank You … etc</em></li>
</ul>
<span class="hhblue">2. Field types</span><br>
You can use field type switches as a prefix for field name, separated by underscore “_”. No other underscores allowed in field names.<br>
<br>
In Form Processor Pro 4.0 field types can take the following values:<br>
<table border="0" cellpadding="3" cellspacing="1" bgcolor="#666666">
<tr bgcolor="#FFFFFF">
<td width="25" align="center"><strong>r</strong></td>
<td>Required field</td>
</tr>
<tr bgcolor="#F8F8F8">
<td align="center"><strong>e</strong></td>
<td> Valid E-mail address</td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="center"><strong>d</strong></td>
<td>Digits and decimal point</td>
</tr>
<tr bgcolor="#F8F8F8">
<td align="center"><strong>c</strong></td>
<td>Digits, decimal point and leading dollar sign ($) only. (currency)</td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="center"><strong>w</strong></td>
<td>Word characters only (A-Z, a-z, 0-9)</td>
</tr>
<tr bgcolor="#F8F8F8">
<td align="center"><strong>s</strong></td>
<td>Leading and trailing spaces are removed</td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="center"><strong>n</strong></td>
<td>New line characters are removed</td>
</tr>
<tr bgcolor="#F8F8F8">
<td align="center"><strong>m</strong></td>
<td>Multiple selections (for checkboxes and radio buttons)</td>
</tr>
</table>
<br>
<strong>Detailed description of the types:</strong><br>
<br>
<span class="hhorange">r</span><br>
The field must be filled in. If user will forget to fill this field it will be reminded by the script message.<br>
<u>Example:</u><br>
<em><input type="text" name="r_Name"></em><br>
<br>
<span class="hhorange">e</span><br>
The value must look like a valid email address, otherwise user will be informed by the script.<br>
<u>Example:</u><br>
<em><input type="text" name="e_eMail"></em><br>
<br>
<span class="hhorange">d</span><br>
The value may only contain digits (0-9) and decimal point, otherwise, user will be informed by the script.<br>
<u>Example:</u><br>
<em><input type="text" name="d_Year"></em><br>
<br>
<span class="hhorange">c</span><br>
The value may only contain digits (0-9), decimal point and leading dollar sign (this type is often called currency type). If user mistaken it will be informed by the script. Can be used in arithmetic calculations; result will contain dollar sign ($).<br>
<u>Example:</u><br>
<em><input type="text" name="c_Price"></em><br>
<br>
<span class="hhorange">w</span><br>
The value may only contain "word" characters (range of A-Z, a-z, 0-9), otherwise user will be informed by the script.<br>
<u>Example:</u><br>
<em><input type="text" name="w_Login"></em><br>
<br>
<span class="hhorange">s</span><br>
The value’s leading and trailing white space will be removed.<br>
<u>Example:</u><br>
<em><input type="text" name="s_Command"></em><br>
<br>
<span class="hhorange">n</span><br>
All new line characters are removed from the value.<br>
<u>Example:</u><br>
<em><textarea cols="20" rows="5" name="n_description"></textarea></em><br><br>
<span class="hhorange">m</span><br>
Used in list box and checkboxes to process multiple selections with one name and put all data into one string. <br>
<u>Example:</u><br>
<em><input type="checkbox" name="m_fashion" value="classic"></em><br>
<em><input type="checkbox" name="m_fashion" value="casual"></em><br>
<em><input type="checkbox" name="m_fashion" value="urban"></em><br>
If you select all checkboxes in form result is: classic,casual,urban<br><br>
Please refer to <a href="055_working_with_multiple_select_fields.html" class="ssilka">FPP Learning / Working with Multiple Select Fields</a> for more details.<br><br>
<span class="hhblue">NOTE:</span> You can combine the switches to take more effect on field values.<br>
<u>Example:</u><br>
<em><input type="text" name="res_eMail"></em><br>
will generate required field (r) with valid e-mail address (e); leading and trailing spaces are removed (s).<br><br>
<span class="hhblue">3. Arithmetical calculations</span><br>
To do arithmetic, place the calculation in brackets like [< ... >]. Variables will be filled out before being calculated. Supported operators: "+" - sum, "-" minus, "/" - division and "*" - multiplication.<br>
<u>Examples:</u><br>
<em>[< [d_age] / 2 >]</em><br>
Will be given the value of [d_age] divided by 2.<br>
<em>[< ([item1] + [item2] + [item3]) * [tax] >] </em><br>
Will add up the items and multiply them by the tax rate.<br><br>
<span class="hhblue">4. Round function</span><br>
round (value, precision) - will round value to precision decimal point. If default value is set from the _round variable in the form (see Local Form Configuration File for more details) then function can be round (value).<br>
<u>Example:</u><br>
<em>[<round ([Number], [Digits])>]</em><br>
If Number = 123.4846 and Digits = 3 then result is: 123.485<br><br>
<span class="hhblue">5. IF condition</span><br>
ifcond ((expr1),(expr2),(expr3)) - evaluates and print result to expr2 if expr1 evaluates to TRUE, and expr3 if expr1 evaluates to FALSE<br>
<u>Example:</u><br>
<em>[<ifcond (([Number1] > [Number2]), ([Number3+10]),([Number3]))>]</em>,<br>
<em>Number1 = 125</em><br>
<em>Number2 = 100</em><br>
<em>Number3 = 50</em><br>
Result: 60<br><br>
<span class="hhblue">NOTE:</span> you can use this function for more sophisticated conditions. For example: if value payment = cc then _browser_out = credit-card-processing.html if not then another condition etc.<br><br>
<span class="hhblue">6. Read-only fields</span><br>
Fields in the templates such as<em> [%HTTP_REFERER], [%REMOTE_HOST], [%DATE_GMT]</em> will be substituted with their counterpart environment values. They must begin with a % (percent) sign. You cannot require an environment setting- if it is not set it will be left blank.<br>
See section <a href="#" class="path">FPP Learning / Server Variables</a> for more details.<br><br>
<em>[unique_reference_number]</em> is field that contains unique reference number generated by Form Processor Pro on the form submission. It is used to determine and mark transaction; useful in shopping carts etc. The field contains value kind of <em>20030409-1013-4109</em>, which is never repeated.<!-- InstanceEndEditable --></td>
</tr>
</table></td>
</tr>
<tr>
<td height="42" align="center" valign="bottom"><!-- InstanceBeginEditable name="navbottom" -->
<table height="27" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="34" valign="top"><a href="033_local_form_configuration_file.html"><img src="images/nav_back.gif" alt="< back" width="34" height="7" border="0"></a></td>
<td width="21" valign="top"><img src="images/delimiter_2b.gif" width="1" height="7" hspace="10" border="0"></td>
<td width="55" valign="top"><a href="035_email_template.html"><img src="images/nav_forward.gif" alt="forward >" width="55" height="7" border="0"></a></td>
</tr>
</table>
<!-- InstanceEndEditable --></td>
<td height="42"> </td>
</tr>
<tr>
<td height="37" align="center" valign="top"><span class="copyright">© 2003 Email-Form.com. All Rights reserved.</span></td>
<td height="37" align="right" valign="top"><a href="#top" target="_self"><img src="images/nav_top.gif" width="75" height="15" border="0"></a></td>
</tr>
</table>
</body>
<!-- InstanceEnd --></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -