Conflito nos Eventos Load
Estou com um problema de conflito quando clica no botão SUBMIT
<style rel="stylesheet" type="text/css">
.loading-button{
display:none;
position:fixed;
overflow:visible;
top:0px;
left:0px;
width:100%;
height:100%;
background-color:rgb(0,0,0);
background-color:rgba(0,0,0, 0.6);
opacity:0.80;
-moz-opacity:0.80;
filter: alpha(opacity=80);
z-index:99;
}
</style>
<script type="text/javascript">
$().ready(function(){
$('#loading-button').show();
$('[id$=loading-button]').submit(function(){
$('#loading-box').show();
});
});
</script>
<div id="loading-box" class="loading-button">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" height="100%" align="center" valign="middle">
<center><img src="<?php print $link_img ?>loading.gif" border="0" title="" alt="" /></center>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
function validCheckBox(){
var checked = false, elem, i = 0, f = document.forms[1];
while(elem = f.elements[i++]){
if(elem.type == "checkbox" && elem.checked){
checked = true;
break;
}
}
if(checked){
document.form.submit();
}
else{
jQuery.fancybox({
'autoScale':false,
'autoDimensions':false,
'autoSize':true,
'autoHeight':true,
'autoWidth':true,
'maxWidth':980,
'maxHeight':600,
'minWidth':300,
'minHeight':100,
helpers:{
overlay:{closeClick:false},
title:null
},
'content':"<div class=\"view-box\"><div id=\"dialog\"><center>Selecione uma opção.<br /><br /><input class=\"button\" type=\"button\" onclick=\"jQuery.fancybox.close();\" value=\"Ok\" /></center></div></div>"
});
}
return checked;
}
</script>
<?php echo "<form id=\"loading-button\" name=\"form\" action=\"insert.php\" method=\"post\" enctype=\"multipart/form-data\" onsubmit=\"return validCheckBox(); return false;\">"; ?>
ao clicar no botão e nao tiver nenhum checkbox selecionado aparece a mensagem em modal, porém ativa o outro load de carregamento e como a DIV fica sobreposta nao consigo fazer mais nada na tela, como faço para manter os 2 funcionando sem conflitos?Discussão (0)
Carregando comentários...