Simple JS validation for two contact forms
The simplest way to minimise your code is to change the functions you've written to accept parameters.

HTML:


&lt;form action="contact.php" method="post" name="form1" 
    onsubmit="return validateForm(this)"&gt;
...
&lt;input type="email" name="conEmail" id="inputConfirmMail1" 
    onblur="mailConfirm(this, 'inputMail1')" placeholder="Confirm E-mail"&gt;


JS:


function validateForm(form) {
  var c = form.name.value;
  var d = form.tel.value;
  var e = form.address.value;
  var f = form.topic.value;
  var g = form.email.value;

  if (!c) {
     alert("insert your name");
     return false;
  }
  else if (!d) {
     alert("insert your telephone");
     return false;
  }
  else if (!e) {
     alert("insert your address");
     return false;
  }
  else if (!f) {
     alert("insert a topic");
     return false;
  }
  else if (!g) {
     alert("insert your email");
     return false;
  }
}

function mailConfirm(input, target) {
  var mail = document.getElementById(target).value;
  var conMail = this.value;
  if(mail != conMail) {
     alert('both emails are not the same');
  }
}


However this doesn't stop you from submitting the form with both email addresses being different or having never entered the confirmation email.

Also, hand writing out every single validation rule for each individual input would be very time consuming and prone to business logic errors.

I would highly recommend you use an open source validator to assist like Parsley or Bootstrap Validator