I want to see if the built in form validation is valid before checking my custom validations. Basically I have a field that is require in the form. The normal, built-in validator will pop up an alert when I click the save button and tells me that the field is required. Basically I want to be able to read the current form state in the DOM and check if the form is valid to submit, then run my custom validation that I write in the client side script.
I currently tried to recreate the onsubmit function that is used in the DOM that is assigned to save button, but the functions it calls (window.NS.form.isInited() &&
window.NS.form.isValid()) always return true no matter the actual validitiy of the form. And then it runs a window.save_record(true) to check if the record has already been submitted. When I try to run that function in the CS script it runs an infinite loop.