Page 1 of 1

I need to hold my validation javascript for requirements

Posted: Thu Apr 27, 2023 5:12 am
by userg19
after i finish to fill up on text box. When I submit to next form. the form is ok but when i send it back on the first form it will be back on enable requirments

$('#dropdownVar004').on("dblclick click keyup keydown",function() {
if(((((((((((($(this).getValue() == "14") || ($(this).getValue() == "13") || ($(this).getValue() == "12") || ($(this).getValue() == "11") || ($(this).getValue() == "10") || ($(this).getValue() == "9") || ($(this).getValue() == "8") || ($(this).getValue() == "7") || ($(this).getValue() == "6") || ($(this).getValue() == "5") || ($(this).getValue() == "4") || ($(this).getValue() == "3")))))))))))) {

$('#multipleFileVar001').enableValidation();

} else {

$('#multipleFileVar001').disableValidation();


}
});

Re: I need to hold my validation javascript for requirements

Posted: Thu Apr 27, 2023 2:31 pm
by ayodelebamgboye
can you please share a screen shot of this
to help understand the context better

Re: I need to hold my validation javascript for requirements

Posted: Sat Apr 29, 2023 7:16 am
by userg19
Hi again here is a short video of the form

Re: I need to hold my validation javascript for requirements

Posted: Mon May 01, 2023 8:37 am
by JonathanMiller
It looks like you are doing all of your validation in an event handler which means if your form opens with data already populated there is no event to run your logic.

What you should try is putting your logic into a function and then calling that function from your event handler. Next you need to call that same function when the form is open. This will cause your validation to run when the event is triggered and once when the form is opened in the case when it is sent back.