<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>ISVALID</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="Description">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">ISVALID</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Description</span>
<p>
Tests whether a value meets a validation or data type rule.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Returns</span>
<p>
True, if the value conforms to the rule; False, otherwise.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Category</span>
<p>
Decision functions
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Function syntax</span><pre>IsValid(type, value)
isValid(&quot;range&quot;, value, min, max) 
isValid(&quot;regex&quot; or &quot;regular_expression&quot;, value, pattern)
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">See also</span>
<p>
cfparam, cfform, IsBoolean, IsDate, IsNumeric, IsSimpleValue; "Validating data with the IsValid function and the cfparam tag" in Chapter&#160;28, "Validating Data," in ColdFusion MX Developer's Guide
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">History</span>
<p>
ColdFusion&#160;MX&#160;7: Added this function. 
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Parameters</span>
<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Usage</span>
<p>
The IsValid function lets you assure that validation is performed on the server. You can use the cfparam tag to perform equivalent validation.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Example</span>
<p>
The following example checks whether a user has submitted a numeric ID and a valid email address and phone number. If any of the submitted values does not meet the validation test, it displays an error message.
</p>
<pre>&lt;cfif isDefined(&quot;form.saveSubmit&quot;)&gt;
   &lt;cfif isValid(&quot;integer&quot;, form.UserID) and isValid(&quot;email&quot;, form.emailAddr) 
         and isValid(&quot;telephone&quot;, form.phoneNo)&gt;
      &lt;cfoutput&gt;
         &lt;!--- Application code to update the database goes here ---&gt;
         &lt;h3&gt;The email address and phone number for user #Form.UserID# 
            have been added&lt;/h3&gt;
      &lt;/cfoutput&gt;
   &lt;cfelse&gt;
      &lt;H3&gt;You must supply a valid User ID, phone number, and email address.&lt;/H2&gt;
   &lt;/cfif&gt;
   &lt;cfelse&gt;
&lt;/cfif&gt;

&lt;cfform action=&quot;#CGI.SCRIPT_NAME#&quot;&gt;
   User ID:&lt;cfinput type=&quot;Text&quot; name=&quot;UserID&quot;&gt;&lt;br&gt;
   Phone: &lt;cfinput type=&quot;Text&quot; name=&quot;phoneNo&quot;&gt;&lt;br&gt;
   email: &lt;cfinput type=&quot;Text&quot; name=&quot;emailAddr&quot;&gt;&lt;br&gt;
   &lt;cfinput type=&quot;submit&quot; name=&quot;saveSubmit&quot; value=&quot;Save Data&quot;&gt;&lt;br&gt;
&lt;/cfform&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="TYPE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">TYPE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


<p>The valid format for the data; one of the following. For detailed information on validation algorithms, see "Validating form data using hidden fields" in Chapter&#160;28, "Validating Data," in ColdFusion MX Developer's Guide.</p><ul>

<li>any: any simple value. Returns false for complex values, such as query objects;; equivalent to the IsSimpleValue function.</li>

<li>array: an ColdFusion array; equivalent to the IsArray function.</li>

<li>binary: a binary value;; equivalent to the IsBinary function.</li>

<li>boolean: a Boolean value: yes, no, true, false, or a number; equivalent to the IsBoolean function.</li>

<li>creditcard: a 13-16 digit number conforming to the mod10 algorithm.</li>

<li>date or time: any date-time value, including dates or times;; equivalent to the IsDate function..</li>

<li>email: a valid email address.</li>

<li>eurodate: any date-time value, including US date formats and time values,</li>

<li>float or numeric: a numeric value; equivalent to the IsNumeric function.</li>

<li>guid: a Universally Unique Identifier of the form &quot;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&quot; where `X' is a hexadecimal number.</li>

<li>integer: an integer. </li>

<li>query: a query object; equivalent to the IsQuery function.</li>

<li>range: a numeric range, specified by the min and max attributes.</li>

<li>regex or regular_expression: matches input against pattern attribute.</li>

<li>ssn or social_security_number: A U.S. social security number.</li>

<li>string: a string value, including single characters and numbers</li>

<li>struct: a structure; equivalent to the IsStruct function.</li>

<li>telephone: a standard US telephone number.</li>

<li>URL: an http, https, ftp, file, mailto, or news URL, </li>

<li>UUID: a ColdFusion Universally Unique Identifier, formatted `XXXXXXXX-XXXX-XXXX-XXXXXXXXXXXXXXX', where `X' is a hexadecimal number. See CreateUUID.</li>

<li>USdate: a U.S. date of the format mm/dd/yy, with 1-2 digit days and months, 1-4 digit years.</li>

<li>variableName: a string formatted according to ColdFusion variable naming conventions.</li>

<li>zipcode: U.S., 5- or 9-digit format ZIP codes.</li>

<li>&#160;</li>
</ul>


  </td>
  </tr>
  </table>
</div>
<div id="VALUE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">VALUE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">The value to test</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">


  </td>
  </tr>
  </table>
</div>
<div id="MIN">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">MIN</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


<p>The minimum valid value; used only for range validation</p>

  </td>
  </tr>
  </table>
</div>
<div id="MAX">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">MAX</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


<p>The maximum valid value; used only for range validation</p>

  </td>
  </tr>
  </table>
</div>
<div id="PATTERN">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">PATTERN</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


<p>A JavaScript regular expression that the parameter must match; used only for regex or regular_expression validation.</p>

  </td>
  </tr>
  </table>
</div>

  </body>
</html>
