summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts
diff options
context:
space:
mode:
authorxue <>2006-07-07 14:54:15 +0000
committerxue <>2006-07-07 14:54:15 +0000
commit61bb16ee2e5f0a66234e1575242169a10fde47b5 (patch)
tree3ee24dcc36ceae2c213130df1ea3d5c9fc110a27 /framework/Web/Javascripts
parent7b84938b1b5964f2274d66e28ba17435924ffe35 (diff)
Merge from 3.0 branch till 1253.
Diffstat (limited to 'framework/Web/Javascripts')
-rw-r--r--framework/Web/Javascripts/js/validator.js8
-rw-r--r--framework/Web/Javascripts/prado/validation3.js15
2 files changed, 21 insertions, 2 deletions
diff --git a/framework/Web/Javascripts/js/validator.js b/framework/Web/Javascripts/js/validator.js
index 43624d38..fd206508 100644
--- a/framework/Web/Javascripts/js/validator.js
+++ b/framework/Web/Javascripts/js/validator.js
@@ -129,9 +129,13 @@ switch(this.options.ControlType)
return this.trim($F(control));else
{this.observeDatePickerChanges();return Prado.WebUI.TDatePicker.getDropDownDate(control).getTime();}
case'THtmlArea':if(typeof tinyMCE!="undefined")
-tinyMCE.triggerSave();return this.trim($F(control));default:if(this.isListControlType())
+tinyMCE.triggerSave();return this.trim($F(control));case'TRadioButton':if(this.options.GroupName)
+return this.getRadioButtonGroupValue();default:if(this.isListControlType())
return this.getFirstSelectedListValue();else
-return this.trim($F(control));}},observeDatePickerChanges:function()
+return this.trim($F(control));}},getRadioButtonGroupValue:function()
+{name=this.control.name;value="";$A(document.getElementsByName(name)).each(function(el)
+{if(el.checked)
+value=el.value;});return value;},observeDatePickerChanges:function()
{if(Prado.Browser().ie)
{var DatePicker=Prado.WebUI.TDatePicker;this.observeChanges(DatePicker.getDayListControl(this.control));this.observeChanges(DatePicker.getMonthListControl(this.control));this.observeChanges(DatePicker.getYearListControl(this.control));}},getSelectedValuesAndChecks:function(elements,initialValue)
{var checked=0;var values=[];var isSelected=this.isCheckBoxType(elements[0])?'checked':'selected';elements.each(function(element)
diff --git a/framework/Web/Javascripts/prado/validation3.js b/framework/Web/Javascripts/prado/validation3.js
index 6285dd52..ae28e1fa 100644
--- a/framework/Web/Javascripts/prado/validation3.js
+++ b/framework/Web/Javascripts/prado/validation3.js
@@ -787,6 +787,9 @@ Prado.WebUI.TBaseValidator.prototype =
if(typeof tinyMCE != "undefined")
tinyMCE.triggerSave();
return this.trim($F(control));
+ case 'TRadioButton':
+ if(this.options.GroupName)
+ return this.getRadioButtonGroupValue();
default:
if(this.isListControlType())
return this.getFirstSelectedListValue();
@@ -795,6 +798,18 @@ Prado.WebUI.TBaseValidator.prototype =
}
},
+ getRadioButtonGroupValue : function()
+ {
+ name = this.control.name;
+ value = "";
+ $A(document.getElementsByName(name)).each(function(el)
+ {
+ if(el.checked)
+ value = el.value;
+ });
+ return value;
+ },
+
/**
* Observe changes in the drop down list date picker, IE only.
*/