I have a webpage with a text box.
When the user enters information into it, he calls an AJAX call to check if the record is valid if it does not disable the button.
They can also contain up to 10 text fields that are executed using jQuery templates. Currently, each text field has a serial number class, and when the serial text field is blurry, it performs this check.
If they enter an invalid serial number, it will disable this button, but if they add a new text field and that it is valid, the button is now enabled, which is incorrect, since it is still not valid.
The only way I can do this is to add 1 or 0 to the array for each text field and after all the elements in the array are 1, then turn on the button. This is a good approach, if not please explain the best. If this is a good approach, how can I check if all values ββin javascript array are the same?
thanks
source share