You are viewing limited content. For full access, please sign in.

Question

Question

Ignore required fields on modern designer - JavaScript

asked on March 10

Hi guys,

Is there anyone that can assist with script for ignoring required field that are hidden in the modern designer form using Js, I know we could simply remove validations on the form but there are some important required fields we need to remain required.

This is what we would usually do in the classic designer: 

    function ignoreRequired() {
        let inputField = document.getElementById("#q1");

        inputField.removeAttribute("required");

        // Optionally restore it after a short delay (e.g., after form submission attempt)
        setTimeout(() => {
            inputField.setAttribute("required", "true");
        }, 5000);
    }


 

0 0

Replies

replied on March 10

When a Required field is hidden, is it automatically removed from validation until such time as it is not hidden. 
if the field is always visible on the form, it would be easiest to use a field rule to determine when a field might be required

4 0
You are not allowed to follow up in this post.

Sign in to reply to this post.