Q:

Trouble implementing validation using java script in html

I am finding it hard to use js in html as i am new to this. I have tried changing around many different things to get it to work but nothing has been successful. Any advice would be greatly appreciated.  
I have tried everything from changing the input types, actions, if and else if statements, alert function and many more.

function validation() {
  var name = document.getElementById('Name').value;
  var email = document.getElementById('Email').value;
  var tel = document.getElementById('Telephone').value;
  if (Name == '' || Email == '' || Telephone == '')
    alert('action required')
  return false;
} else if (name.length < 4) {
  alert("action required")
  return false;
}
<!DOCTYPE html>
<html lang="en">

<head>
  <meta name="utf-8">
  <link rel="stylesheet" href="css/WebForm.css">
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>COM111 | WebForm | B0076234</title>
  <meta name="viewport" content="width = device-width, inital-scale = 1.0">
  <script src="assignment2/ass2script.js"></script>
  <h1 id="h1">Welcome To My WebForm</h1>
  <h2 id="h2"> CV Request</h2>
</head>

<body>
  <!-- form -->
  <form action="" method="post" onsubmit="return validation()">
    <div class="wrap">
      <div class="form1">
        <div class="input-fields">
          <input type="text" class="input" placeholder="Name" id="name">
          <input type="email" class="input" placeholder="Email" id="Email">
          <input type="tel" class="input" placeholder="Telephone" id="Telephone">
          <input type="text" class="input" placeholder="Company" id="Telephone"><br>
          <input type="submit" name="submit" value="Insert now">
          <!--buttons-->
          <label>Short CV
<input type="radio" checked="checked">
    </label> <br>
          <label>Long CV
     <input type="radio">
    </label>
          <!-- messgebox -->
        </div>
        <div class="message">
          <textarea placeholder="Message"></textarea>
          <div class="btn">send</div>
        </div>
      </div>
    </div>
  </form>
  <!--buttons-->
  <div id="eresult"></div>
  <!-- javascript -->
  <script type="text/javascript">
  </script>

</body>

</html>

A:

Fix the following problems:

You need braces around the block after if, because it contains multiple statements. See Why is it considered a bad practice to omit curly braces?
Add another brace at the end of the function.
Change id="name" to id="Name", to match the call to document.getElementById('Name').
Fix the variable names in the first if statement to match the variables that were assigned from the input values.

All of these validations can actually be implemented in the HTML itself. You can use the required attribute for inputs that have to be filled in, and minlength="4" on the Name input to require that it be at least 4 characters.

function validation() {
  var name = document.getElementById('Name').value;
  var email = document.getElementById('Email').value;
  var tel = document.getElementById('Telephone').value;
  if (name == '' || email == '' || tel == '') {
    alert('action required')
    return false;
  } else if (name.length < 4) {
    alert("action required")
    return false;
  }
}
<!DOCTYPE html>
<html lang="en">

<head>
  <meta name="utf-8">
  <link rel="stylesheet" href="css/WebForm.css">
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>COM111 | WebForm | B0076234</title>
  <meta name="viewport" content="width = device-width, inital-scale = 1.0">
  <script src="assignment2/ass2script.js"></script>
  <h1 id="h1">Welcome To My WebForm</h1>
  <h2 id="h2"> CV Request</h2>
</head>

<body>
  <!-- form -->
  <form action="" method="post" onsubmit="return validation()">
    <div class="wrap">
      <div class="form1">
        <div class="input-fields">
          <input type="text" class="input" placeholder="Name" id="Name">
          <input type="email" class="input" placeholder="Email" id="Email">
          <input type="tel" class="input" placeholder="Telephone" id="Telephone">
          <input type="text" class="input" placeholder="Company" id="Telephone"><br>
          <input type="submit" name="submit" value="Insert now">
          <!--buttons-->
          <label>Short CV
<input type="radio" checked="checked">
    </label> <br>
          <label>Long CV
     <input type="radio">
    </label>
          <!-- messgebox -->
        </div>
        <div class="message">
          <textarea placeholder="Message"></textarea>
          <div class="btn">send</div>
        </div>
      </div>
    </div>
  </form>
  <!--buttons-->
  <div id="eresult"></div>
  <!-- javascript -->
  <script type="text/javascript">
  </script>

</body>

</html>

