KoolForm
|
| | |
KoolRegularExpressionValidator Class [PHP]
ErrorMessageTop string ErrorMessage
Set the message that will display when validation is failed.
Show/Hide Code <?php
$validator = $myform_manager->AddControl(new KoolRegularExpressionValidator("valiadtor"));
$validator->TargetId = "txtEmail";//Validate the Email text box
$validator->ErrorMessage = "Please enter correct email address";
$validator->Expression = "/^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$/";
?>
<div>
<input id="txtEmail" name="txtEmail" /> <?php echo $validator->Render();?>
</div> Supported from version: 1.0.0.0 ExpressionTop string Expression
Set the regular expression that will be used to validate user input.
Show/Hide Code <?php
$validator = $myform_manager->AddControl(new KoolRegularExpressionValidator("valiadtor"));
$validator->TargetId = "txtEmail";//Validate the Email text box
$validator->ErrorMessage = "Please enter correct email address";
$validator->Expression = "/^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$/";
?>
<div>
<input id="txtEmail" name="txtEmail" /> <?php echo $validator->Render();?>
</div> Supported from version: 1.0.0.0 idTop string id
Get the id of validator.
Show/Hide Code <?php
$validator = $myform_manager->AddControl(new KoolRegularExpressionValidator("valiadtor"));
echo $validator->id;
?> Supported from version: 1.0.0.0 TargetIdTop string TargetId
Set the id of textbox that you want to validate.
Show/Hide Code <?php
$validator = $myform_manager->AddControl(new KoolRegularExpressionValidator("valiadtor"));
$validator->TargetId = "txtEmail";//Validate the Email text box
$validator->ErrorMessage = "Please enter correct email address";
$validator->Expression = "/^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$/";
?>
<div>
<input id="txtEmail" name="txtEmail" /> <?php echo $validator->Render();?>
</div> Supported from version: 1.0.0.0
RenderTop void Render()
Render the validator
Show/Hide Code <?php
$validator = $myform_manager->AddControl(new KoolRegularExpressionValidator("valiadtor"));
$validator->TargetId = "txtEmail";//Validate the Email text box
$validator->ErrorMessage = "Please enter correct email address";
$validator->Expression = "/^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$/";
?>
<div>
<input id="txtEmail" name="txtEmail" /> <?php echo $validator->Render();?>
</div> Supported from version: 1.0.0.0
| | |
|