when input hidden deal with script
yewon97 opened this issue · comments
Hello.
<input type="hidden" name="test" value="" />
if i validate this input,
but I update the value using script like $("[name=test]").val('something');
However, the error message does not work dynamically when controlled by script like that.
Maybe it's because it's only supposed to work in events such as input, change, keyup, etc.
Is there any way to solve the above method?
Hey, you are right. I guess you could use this workaround https://stackoverflow.com/questions/3179385/val-doesnt-trigger-change-in-jquery like
$("[name=test]").val('something').trigger("change");