Hello everyone, I have a problem, I have to make a button have "2 functions" in fact everything is working correctly, so my client wants the following ...
When the user clicks register and is all fields correct, it registers and shows the success message in a modal, with a button that redirects to home. And if it fails to fill some field and click the button it shows a message in the label itself.
Here is my modal; / * java modal window services * / var $ j = jQuery.noConflict ();
$j(document).ready(function () {
var nome = $("#txtNome").val();
var mail = $("#txtEmailC").val();
var fone = $("#txtFoneC").val();
if (nome != "" && mail != "" && fone != "") {
//$(document).ready(function () {
$("a[rel=modal]").click(function (ev) {
ev.preventDefault();
var id = $(this).attr("href");
var maskHeight = $(document).height();
var maskWidth = $(window).width();
//colocando cor de fundo
$('#mask').css({ 'width': maskWidth, 'height': maskHeight });
$('#mask').fadeIn(1000);
$('#mask').fadeTo("slow", 0.8);
var winH = $(window).height();
var winW = $(window).width();
$(id).css('top', winH / 2 - $(id).height() / 2);
$(id).css('left', winW / 2 - $(id).width() / 2);
$(id).fadeIn(2000);
});
$('.window2 .close').click(function (ev) {
ev.preventDefault();
$('#mask').hide();
$('.window2').hide();
});
$('#mask').click(function () {
$(this).hide();
$('.window2').hide();
});
//});
}
});
</script>
here is the button that calls the modal if everything is completed right:
Well this is so if someone knows another solution or if you can solve it yourself. Does anyone know how I should do it?