Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-12619

Custom User Profile Fields - Add ability to define an input mask for data validation

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Inactive
    • Affects Version/s: 1.9
    • Fix Version/s: None
    • Component/s: Administration
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE

      Description

      This question has been raised in response to the birthday block; however, I think it has utility regardless of use as it would allow for user's to be forced to input valid data. Using some type of input mask for data validation would be helpful. I'm thinking along the lines of:

      Date (ISO, USA, EUR)

      1. for a digit
        a for lower case alpha
        A for upper case alpha
        @ for alphanumeric
        All other characters would be literal

      Hence a mask for a U.S. phone number could be (###) ###-####

      That way if a Moodle administrator wanted to enforce that the data be entered properly they would have a tool by which to do it. AFAIK, since the data is simply stored as text there is currently no way of validating. The user's of the birthday block would like the users to input a birthday; however, they have no way of enforcing that the user input a valid date.

      Peace - Anthony

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              aborrow Anthony Borrow
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              5 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: