I'm trying to solve a validation problem using Jquery, but I can not use the jquery lib itself to do this validation.
So far I have managed to do a validation using only jquery, however I came across the following problem, when user does not fill in the time field, msg appears "Required Field" on the side of the time field, but when I go give submit again with the field not filled, it repeats the msg again.
Jquerycode
$(document).ready(function(){$('#region_btnSave').click(function(){vartxtHValue=$("#region_tabVersao_N_txtH").val();
var emailAddressValue = $("#region_tabVersao_N_txtM").val();
if (emailAddressValue == '' || txtHValue == '') {
$("#region_tabVersao_N_txtH").after('<span class="error">Campo Obrigadorio</span>',null);
return false;
}
else {
//not all text fields are valid
$("#region_tabVersao_N_txtH").after('', null);
}
});
});
Validation field:
<td>
<asp:TextBox ID="txtH" runat="server" MaxLength="3" Width="40" />
<span class="error"></span>
</td>