Remove Input validation when change using JavaScript

is there any way to remove the validation from input field when it's input changed using java script not ajax refresh

Hi Mohamed Antar,

Just add this on your input widget in Extended properties :

So after the Validation Error Message, the moment you start typing in the input - validation message will be removed.


- Assif

Hi assif_tiger 

thank you for your reply, but after add this the validation message message and red border still visible, i think i need to refresh the input layout but are you know how to do this without ajax refresh ?

Solution


Hi assif_tiger  after search i found that i had to add this java-script function and then call this when element value changed as you say RemoveErrorMessage(this)

function RemoveErrorMessage(el) {
    
    var elementId = el.id;
    var elementHook = document.getElementById(elementId);
    
    if(elementHook.classList.contains('Not_Valid')) // check whether the current element contains class 'Not_Valid'
    {
        elementHook.classList.remove('Not_Valid');
        elementHook.nextSibling.style.display = 'none';
    // $('#' + elementId).next('span').hide(); // using jQuery
    }
}
Solution