// RadioCheckRequiredCondition.class.js (Fertile Form JS Framework) || Version: 0.01 || Last Updated: 2010-08-26 17:00 || Updated by: Hidde-Finne Peters || Created: 2010-08-25 by Hidde-Finne Peters
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//	Radio field is fetched differently

var RadioCheckRequiredCondition = FormCondition.extend({

	init: function (feedbackString, fieldObject) {
		this._super(feedbackString, fieldObject);
	},
	
	//	------------------------------------------------------------------------------------------------------------
	//	--- update -------------------------------------------------------------------------------------------------	0.00
	//	------------------------------------------------------------------------------------------------------------
	//	Methods called to change properties dynamically
	
	//	Reanalyze situation and set property "this.valid" accordingly
	updateValid: function () {
		if (this.field) {
			var checkedInput = $('input[name='+ this.field.attr('name') +']:radio:checked');
			if (checkedInput.length > 0) {
				this.setValid(true);
				return;
			}
		}
		this._super();
	}
	
	//	------------------------------------------------------------------------------------------------------------
	//	------------------------------------------------------------------------------------------------- update ---
	//	------------------------------------------------------------------------------------------------------------
	
});
