diff options
4 files changed, 56 insertions, 1 deletions
diff --git a/.gitattributes b/.gitattributes index 21d8f6d3..53f366ee 100644 --- a/.gitattributes +++ b/.gitattributes @@ -173,6 +173,8 @@ demos/quickstart/protected/pages/Controls/Samples/TRadioButton/Home.page -text demos/quickstart/protected/pages/Controls/Samples/TRadioButton/Home.php -text demos/quickstart/protected/pages/Controls/Samples/TRadioButtonList/Home.page -text demos/quickstart/protected/pages/Controls/Samples/TRadioButtonList/Home.php -text +demos/quickstart/protected/pages/Controls/Samples/TRangeValidator/Home.page -text +demos/quickstart/protected/pages/Controls/Samples/TRangeValidator/Home.php -text demos/quickstart/protected/pages/Controls/Samples/TRegularExpressionValidator/Home.page -text demos/quickstart/protected/pages/Controls/Samples/TRegularExpressionValidator/Home.php -text demos/quickstart/protected/pages/Controls/Samples/TRepeater/Sample1.page -text diff --git a/demos/quickstart/protected/pages/Controls/Samples/TRangeValidator/Home.page b/demos/quickstart/protected/pages/Controls/Samples/TRangeValidator/Home.page new file mode 100644 index 00000000..2e8de045 --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TRangeValidator/Home.page @@ -0,0 +1,45 @@ +<com:TContent ID="body">
+
+<h1>TRangeValidator Samples</h1>
+<p><strong>Note:</strong> TRangeValidator will start
+to validate only if both inputs are not empty.</p>
+
+<table class="sampletable">
+
+<tr>
+<td class="samplenote">
+Range validator with default settings:
+</td>
+<td class="sampleaction">
+<com:TTextBox ID="TextBox1" Text="a1" />
+<com:TRangeValidator
+ ControlToValidate="TextBox1"
+ ValidationGroup="Group1"
+ MinValue="aaa"
+ MaxValue="zzz"
+ Text="Input must be between 'aaa' and 'zzz'." />
+<com:TButton Text="Submit" ValidationGroup="Group1" />
+</td>
+</tr>
+
+<tr>
+<td class="samplenote">
+Range validator with client-side validation disabled:
+</td>
+<td class="sampleaction">
+<com:TTextBox ID="TextBox2" Text="11"/>
+<com:TRangeValidator
+ ValidationGroup="Group2"
+ EnableClientScript="false"
+ ControlToValidate="TextBox2"
+ DataType="Integer"
+ MinValue="100"
+ MaxValue="999"
+ Text="Input must be between 100 and 999." />
+<com:TButton Text="Submit" ValidationGroup="Group2" />
+</td>
+</tr>
+
+</table>
+
+</com:TContent>
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Samples/TRangeValidator/Home.php b/demos/quickstart/protected/pages/Controls/Samples/TRangeValidator/Home.php new file mode 100644 index 00000000..88d2dbf2 --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/Samples/TRangeValidator/Home.php @@ -0,0 +1,8 @@ +<?php
+
+class Home extends TPage
+{
+
+}
+
+?>
\ No newline at end of file diff --git a/framework/Web/UI/WebControls/TRangeValidator.php b/framework/Web/UI/WebControls/TRangeValidator.php index a861c9d6..842797ba 100644 --- a/framework/Web/UI/WebControls/TRangeValidator.php +++ b/framework/Web/UI/WebControls/TRangeValidator.php @@ -227,7 +227,7 @@ class TRangeValidator extends TBaseValidator if($dateFormat!=='')
{
$formatter=Prado::createComponent('System.Data.TSimpleDateFormatter', $dateFormat);
- $value = pradoParseDate($value, $dateFormat);
+ $value = $formatter->parse($value, $dateFormat);
if($minValue!=='')
$valid=$valid && ($value>=$formatter->parse($minValue));
if($maxValue!=='')
|