summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/Javascripts')
-rw-r--r--framework/Web/Javascripts/js/validator.js9
-rw-r--r--framework/Web/Javascripts/prado/validation3.js14
2 files changed, 20 insertions, 3 deletions
diff --git a/framework/Web/Javascripts/js/validator.js b/framework/Web/Javascripts/js/validator.js
index 5e896aa1..711c996e 100644
--- a/framework/Web/Javascripts/js/validator.js
+++ b/framework/Web/Javascripts/js/validator.js
@@ -97,7 +97,8 @@ control.addClassName(CssClass);}},hide:function()
{this.isValid=true;this.updateControl();this.visible=false;},validate:function(invoker)
{if(typeof(this.options.OnValidate)=="function")
this.options.OnValidate(this,invoker);if(this.enabled)
-this.isValid=this.evaluateIsValid();if(this.isValid)
+this.isValid=this.evaluateIsValid();else
+this.isValid=true;if(this.isValid)
{if(typeof(this.options.OnSuccess)=="function")
{this.visible=true;this.message.style.visibility="visible";this.updateControlCssClass(this.control,this.isValid);this.options.OnSuccess(this,invoker);}
else
@@ -126,7 +127,11 @@ return value;},getValidationValue:function(control)
control=this.control
switch(this.options.ControlType)
{case'TDatePicker':if(control.type=="text")
-return this.trim($F(control));else
+{value=this.trim($F(control));if(this.options.DateFormat)
+{date=value.toDate(this.options.DateFormat);return date==null?'':date;}
+else
+return value;}
+else
{this.observeDatePickerChanges();return Prado.WebUI.TDatePicker.getDropDownDate(control).getTime();}
case'THtmlArea':if(typeof tinyMCE!="undefined")
tinyMCE.triggerSave();return this.trim($F(control));case'TRadioButton':if(this.options.GroupName)
diff --git a/framework/Web/Javascripts/prado/validation3.js b/framework/Web/Javascripts/prado/validation3.js
index 1dba23da..7df6efeb 100644
--- a/framework/Web/Javascripts/prado/validation3.js
+++ b/framework/Web/Javascripts/prado/validation3.js
@@ -661,6 +661,8 @@ Prado.WebUI.TBaseValidator.prototype =
if(this.enabled)
this.isValid = this.evaluateIsValid();
+ else
+ this.isValid = true;
if(this.isValid)
{
@@ -776,7 +778,17 @@ Prado.WebUI.TBaseValidator.prototype =
{
case 'TDatePicker':
if(control.type == "text")
- return this.trim($F(control));
+ {
+ value = this.trim($F(control));
+
+ if(this.options.DateFormat)
+ {
+ date = value.toDate(this.options.DateFormat);
+ return date == null ? '' : date;
+ }
+ else
+ return value;
+ }
else
{
this.observeDatePickerChanges();