title: How to cut short multiple if else statements in Javascript
body: <p>I recently came across a situation where I was working on a huge form with atleast 60 fields and I wanted that form to only submit if all fields were filled and if not, I wanted to show a custom message (Sweetalert) for every field not filled.
  For example, If first name was left empty, show the message &quot;Please enter your first name&quot;, If country of residence was not selected, show them the message that &quot;Please select your country of residence&quot; so on and so forth.
  While I was writing tons of if and else statements to match every field using <code>document.getElementById()</code>, this thought of not doing things right came into my mind. I tried searching the web for this but was unable to find a suitable way of doing such things. Can anyone suggest me a better way rather then writing if else statements of 100 lines ?</p>