0

I'm developing an application which schedules a job. Now, I have radio buttons for Monthly, Weekly, Daily and for specific days. Now, if the user selects the last radio button, I show checkboxes for all days(Sunday, Monday...). I have put knockout validations for the radio buttons

 self.processSchedule.ScheduleType.subscribe(function (newValue) {
        resetSubcontrolsForScheduleType();
    });

Now, if the radio button selection is changed, the validation on the radio buttons is getting triggered correctly. What I need is if any of the checkboxes for the days are checked, I need that validation on the radio buttons to be triggered. Is there a way we can have a validation on radio buttons get triggered when the value of a checkbox is changed?

kmatyaszek
  • 19,016
  • 9
  • 60
  • 65
Feroz
  • 351
  • 1
  • 5
  • 20
  • Here is how I'm validating the radio button. self.processSchedule.ScheduleType.extend({ validation: { validator: function (val, someOtherVal) { if (self.processSchedule.ScheduleType().toString() == "1") { return isAnyOfTheSpecificDaysSelected(); } else { return true; } }, message: 'Please select atleast one day.' } }); – Feroz Oct 14 '12 at 19:49
  • ScheduleType is a Radio button set and currently this is happening if the radio button's value gets changed. I want this to happen on a checkbox getting checked/unchecked. – Feroz Oct 14 '12 at 19:59

0 Answers0