summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/base
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/Javascripts/base')
-rw-r--r--framework/Web/Javascripts/base/postback.js7
-rw-r--r--framework/Web/Javascripts/base/validation.js4
-rw-r--r--framework/Web/Javascripts/base/validators.js10
3 files changed, 14 insertions, 7 deletions
diff --git a/framework/Web/Javascripts/base/postback.js b/framework/Web/Javascripts/base/postback.js
index b7e095a4..186495cc 100644
--- a/framework/Web/Javascripts/base/postback.js
+++ b/framework/Web/Javascripts/base/postback.js
@@ -13,7 +13,12 @@ Prado.doPostBack = function(formID, eventTarget, eventParameter, performValidati
if (performValidation)
{
//canSubmit = Prado.Validation.validate(validationGroup);
- canSubmit = Prado.Validation.OnSubmit(theForm);
+ /* Prado.Validation.ActiveTarget = theForm;
+ Prado.Validation.CurrentTargetGroup = null;
+ Prado.Validation.IsGroupValidation = false;
+ canSubmit = Prado.Validation.IsValid(theForm);
+ Logger.debug(canSubmit);*/
+ canSubmit = Prado.Validation.IsValid(theForm);
}
if (canSubmit)
{
diff --git a/framework/Web/Javascripts/base/validation.js b/framework/Web/Javascripts/base/validation.js
index ceebc2ba..e7fa9203 100644
--- a/framework/Web/Javascripts/base/validation.js
+++ b/framework/Web/Javascripts/base/validation.js
@@ -152,7 +152,7 @@ Prado.Validation.Util.toDate = function(value, format)
*/
Prado.Validation.Util.trim = function(value)
{
- if(undef(value)) return "";
+ if(!isString(value)) return "";
return value.replace(/^\s+|\s+$/g, "");
}
@@ -367,6 +367,8 @@ Prado.Validation.prototype =
*/
update : function()
{
+ Logger.info("isvalid ? " + this.isValid);
+
if(this.attr.display == "Dynamic")
this.isValid ? Element.hide(this.message) : Element.show(this.message);
diff --git a/framework/Web/Javascripts/base/validators.js b/framework/Web/Javascripts/base/validators.js
index 99d6b416..2f49eb12 100644
--- a/framework/Web/Javascripts/base/validators.js
+++ b/framework/Web/Javascripts/base/validators.js
@@ -6,7 +6,7 @@ Prado.Validation.TRequiredFieldValidator=function(){
}
else{
var trim=Prado.Validation.Util.trim;
- var a=trim(Form.Element.getValue(this.control));
+ var a=trim($F(this.control));
var b=trim(this.attr.initialvalue);
return(a!=b);
}
@@ -16,7 +16,7 @@ Prado.Validation.TRequiredFieldValidator=function(){
Prado.Validation.TRegularExpressionValidator = function()
{
var trim = Prado.Validation.Util.trim;
- var value = trim(Form.Element.getValue(this.control));
+ var value = trim($F(this.control));
if (value == "") return true;
var rx = new RegExp(this.attr.validationexpression);
var matches = rx.exec(value);
@@ -36,7 +36,7 @@ Prado.Validation.TCustomValidator = function()
Prado.Validation.TRangeValidator = function()
{
var trim = Prado.Validation.Util.trim;
- var value = trim(Form.Element.getValue(this.control));
+ var value = trim($F(this.control));
if (value == "") return true;
var minval = this.attr.minimumvalue;
@@ -63,7 +63,7 @@ Prado.Validation.TRangeValidator = function()
Prado.Validation.TCompareValidator = function()
{
var trim = Prado.Validation.Util.trim;
- var value = trim(Form.Element.getValue(this.control));
+ var value = trim($F(this.control));
if (value.length == 0) return true;
var compareTo;
@@ -71,7 +71,7 @@ Prado.Validation.TCompareValidator = function()
var comparee = $(this.attr.controlhookup);;
if(comparee)
- compareTo = trim(Form.Element.getValue(comparee));
+ compareTo = trim($F(comparee));
else
{
compareTo = isString(this.attr.valuetocompare) ? this.attr.valuetocompare : "";