3 Replies Latest reply on May 13, 2008 9:24 AM by ilya_shaikovsky

    rich:calendar validate

      how to I validate a component rich:calendar in a range of Date?
      i.e.
      I need validate the calendar for show dates where year > 1900


      thanks, very much!

        • 1. Re: rich:calendar validate
          ilya_shaikovsky

          you may use oncurrentdayselect client side event. This event cancelable.

          Just get current date in the handler from calendar using

          event.rich.date
          

          variable. And check if this new date is in range. If not - just return false and calendar will not be switched.

          • 2. Re: rich:calendar validate
            lucab

            i tryed to use oncurrentdateselect and oncurrentdateselected, None of them worked form me.

            oncurrentdateselect(ed)=my_func(evet) does not work form me, How am i supposed to use that??

            • 3. Re: rich:calendar validate
              ilya_shaikovsky

              look I've written just

              oncurrentdateselect="if (event.rich.date.getFullYear() > '2009'){return false;}"
              


              in this case - calendar do not allows to change the year to more than 2009