This function basically creates a string with checked options.
We loop through all elements of block "actioncheck" and if we get a positive value (checked option)
we add the value of that choice to an array.
When loop finishes we create a string from the array we got joining all the elements with "," character.
This function throws a basic JS check on the form.
The first check looks for empty input elements and if found, we add a class "has-error" to
that element to get recognized by the user as "wrong" filled (honestly not filled at all).
The second check looks if email address is e-mail like and if the vendor number is numeric.
Whenever an error occurs we increment our counter by 1, in the end if the counter is > 0
event which triggers the AJAX request to save the form isn't called.
Rewritten the entire function.