Skip to content
Advertisement

How do I implement a button, that checks if the fields in a document are not empty? JavaScript

I want to write a JavaScript function, that checks if the fields in the following HTML document are not empty. I do not want a prompt for every information but instead I want to implement a button at the end, that checks every field and returns a message that tells you which fields are still not filled.

JavaScript

I started to create variables to read the content of the fields but have an error message already

(“Expression expected”) in line 4

JavaScript

I hope you can help me.

Advertisement

Answer

Try something like this:

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement