Solved Javascript Form Validation

So I have a form validator which I want the form validation to be handled on the backend by the server for security purposes rather than on the front end. I would also like to keep the user's file extensions to be the same, so if their website would have an extension of .html then it would remain .html. That being said I would like to have a Javascript that will make the text fields red (to start off with). So I have the following Javascript code: