I have this submit from my form that comes from php
, I wanted to validate two fields within it from cnpj and date. How to do?
$("#more").submit(function repeatLink (event) {
event.preventDefault();
alert('estou aqui');
var link = $("#link").val();
var date = $("#date-foundation").val();
var validation = true;
if (link === null || link === '') {
$("#link").addClass("input-required");
validation = false;
}
if (validation === true) {
$.ajax({
url: './model/functions/link_repeat.php',
type: 'POST',
data: {link: link},
success: function (data) {
alert(data);
if (data === 'true') {
$("#link").addClass("input-required");
$("#alert-link").append("<span style='color:red'><b>Esse link já existe! Escolha outro!</b></span>");
return;
}
}
});
}
})