<form id="main-form" onsubmit="CheckForm(this)" method="post">
<label for="name">Введите имя: </label>
<input type="text" name="name" id="name" placeholder="Имя"> <br><br>
<label for="password">Введите пароль: </label>
<input type="password" name="pass" id="pass" placeholder="Пароль"> <br><br>
<label for="repas">Подтвердите пароль: </label>
<input type="password" name="repas" id="repas" placeholder="Пароль"> <br><br>
<label for="man">М: </label>
<input type="radio" name="state" id="man" >
<label for="woman">Ж: </label>
<input type="radio" name="state" id="woman" > <br><br>
<input type="submit" name="submit" value="Готово">
</form>
function CheckForm(el) {
var name = el.name.value;
console.log(name);
}