Whenever I click on the submit button, nothing happens. An error is displayed as follows: Form.js:102 Uncaught TypeError: Cannot set property 'onsubmit' of null. I am having trouble understanding why this error occurs...
// JavaScript Document function validate() { var x = document.forms["myForm"]["ide"].value; var regex = /^[1-9]{1}[0-9]{9}$/; if (x == null || x == "") { alert("Enter Your ID Number"); return false; } else if (!regex.test(x)) { alert("ID Contain Numbers Only"); return false; } var x = document.forms["myForm"]["EName"].value; var regex = /^[A-Za-z]+$/; if (x == null || x == "") { alert("Enter Your Employee Name"); return false; } else if (!regex.test(x)) { alert("Employee Name Contain Alphabets Only"); return false; } ...
Click here to view Form.html.