I have a validation script (calling out its parent script) that I would like to change.
I would like to display a hidden DIV as an alert above the form when an error is found.
Is there a way to add this to my existing script:
<script type="text/javascript">
$(function () {
$('#rbSubmit').formValidator({
scope: '#form_register',
onError: function () {
if ($('#input_1 input').hasClass('error-input')) {
$('#r1 div, #r1 input').css('background-color', '#C1272D').css('color', '#FFF');
} else {
$('#r1 div').css('background-color', '#E8E8E8');
}
if ($('#input_1 input').hasClass('error-input')) {
$("#r1 .ts").css("background-position", "-928px -318px");
} else {
$('#r1 div').css('background-color', '#E8E8E8');
}
if ($('#input_2 input').hasClass('error-input')) {
$('#r2 div, #r2 input').css('background-color', '#C1272D').css('color', '#FFF');
} else {
$('#r2 div').css('background-color', '#E8E8E8');
}
}
});
});
</script>
http://api.jquery.com/html/
Hopefully this is what you were looking for.