0
$("#more").submit(function (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;
}
}
});
}
});
Hello Ana, can you explain better what you mean by "call the
onblur
from that Ubmit"? Do you have any event headphonesblur
that you want to trigger when `Submit`` occurs, that’s it?– Sergio
Actually the onblur I call through the function name right. And in this case I want to put it in my input. How to put? onblur = ?
– Ana Carolina Ribeiro
So you can’t just invoke the function before ajax? simply with
minhaFuncao();
in the code?– Sergio
then in this case my function has no name, as you would call her?
– Ana Carolina Ribeiro
Hmmm... I still don’t get it. Can you explain in steps what you want to happen? For example: click on Submit > triggers the form’s Submit and runs the code in question > and then?...
– Sergio
So I have an input where I’m doing a validation, I just want it to validate if the person changes what’s written. If the person does not touch the input is not to validate.
– Ana Carolina Ribeiro
Okay, what’s the logic to validate? What do you call that logic? It’s through
blur
when you click the buttonsubmit
?– Sergio