Moodle
  1. Moodle
  2. MDL-7816

Quickform: allow date selector to be optional (with checkbox)

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: None
    • Component/s: Forms Library
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE
    • Rank:
      11778

      Description

      It would be good if the date_selector form type had an 'optional' parameter that automatically added a checkbox to the same field, which would then set the value to 0 unless the checkbox was checked.

        Activity

        Hide
        Sam Marshall added a comment -

        (Thanks for your email, replying here since you'll get this anyway.)

        I have checked in the changes I made to dateselector, after also making the requested change to move the checkbox to the end of the group and add the 'Enabled' label. (To be honest I think the way I had it first - checkbox before date - was better UI, but I have no intention of arguing about it!)

        I also had to make a small change to the standard theme in order for the checkbox label to work right.

        The 'disabledIf' behaviour is something we used to have as well in my old forms library, I was too lazy to try to figure it out this time (today is the first I ever looked at formslib stuff). So, yes, please do add that! Assigning to you for that.

        Show
        Sam Marshall added a comment - (Thanks for your email, replying here since you'll get this anyway.) I have checked in the changes I made to dateselector, after also making the requested change to move the checkbox to the end of the group and add the 'Enabled' label. (To be honest I think the way I had it first - checkbox before date - was better UI, but I have no intention of arguing about it!) I also had to make a small change to the standard theme in order for the checkbox label to work right. The 'disabledIf' behaviour is something we used to have as well in my old forms library, I was too lazy to try to figure it out this time (today is the first I ever looked at formslib stuff). So, yes, please do add that! Assigning to you for that.
        Hide
        Jamie Pratt added a comment -

        This is done.

        Show
        Jamie Pratt added a comment - This is done.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: