javascript - Click the submit button to check the values of all inputs on the page and pop up a prompt if any one is empty
phpcn_u15822017-05-19 10:17:02
0
1
478
There are originally 5 inputs in the page. Clicking the "Add button" will add a new input to the page. When clicking the Submit button and any input is empty, it cannot be submitted and an alert prompt pops up. How to do this?
Use the valid plug-in, or read the data in a loop yourself. Once it is empty, alert immediately and return false, otherwise continue.