DFFS Form Validation

Home Forums Classic DFFS DFFS Form Validation

Viewing 3 reply threads
  • Author
    Posts
    • #28191
      Filipe Ribeiro
      Participant

        Hello,

        Trying to format the looks of the input when DFFS validates a required empty field but I’m having trouble achieving the expected result

        The case is, if the field is required and when save button is pressed, a div with class dffs-formvalidation and the message is added next to the input wrapper, so in order to change the looks of the required field must target the parent span and the input inside it and add a css class at leat in my mind :). Can anyone help me out?

      • #28194
        Alexander Bautz
        Keymaster

          Try adding this to your custom js:

          setInterval(function () {
              // Remove first
              jQuery(".customValidationClass").each(function () {
                  if (jQuery(this).find(".dffs-formvalidation").length === 0) {
                      jQuery(this).removeClass("customValidationClass");
                  }
              });
              // Add if not already present
              jQuery(".dffs-formvalidation").each(function () {
                  if (jQuery(this).parents("tr:first").find(".customValidationClass").length === 0) {
                      jQuery(this).parents("td.ms-formbody").addClass("customValidationClass");
                  }
              });
          }, 1000);

          and this to your custom css:

          .customValidationClass{
              box-shadow: 0 0 8px red;
          }

          Let me know how it works out.

          Alexander

          • This reply was modified 4 years, 11 months ago by Alexander Bautz. Reason: Fixed an error in the code snippet
        • #28204
          Filipe Ribeiro
          Participant

            Hello Alexander

            It worked. Just made minor changes to css so I could target the desired input

          • #28207
            Alexander Bautz
            Keymaster

              Thanks for the feedback – I’m glad you got it working.

              Alexander

          Viewing 3 reply threads
          • You must be logged in to reply to this topic.