1
I have the following validation for the TextBox
justification. But even returning the message and clicking the OK button the system validates the deletion.
The right, should return the message and give a Focus in the justification field, thus preventing the system accepted without justification and/or less than 15 characters.
$("[id$=btnExcluirPedido]").click(function () {
var txtJust = $("[id$=txtJustificativaExc]");
if (txtJust.val().length <= 15 || txtJust.val() == "") {
$("[id$=txtJustificativaExc]").focus();
alert("A justificativa deve conter no mínimo 15 caracteres.");
}
else {
cancelPostback = false;
GrabPageRequestManager();
}
});
What is done after this check in the normal flow? An Ajax call? A common POST?
– Jéf Bueno
@LINQ only one post, in this case validates the exclusion in code Behind. But it should only enter this part if it respects the 15 minimum characters.
– Igor Carreiro
You’ll have to cancel the form Ubmit. There is no place trying to interrupt the normal flow of things, the only thing the code asks to do is show an Alert.
– Jéf Bueno
@LINQ all right, I’ll try this way.
– Igor Carreiro