I have a registration page and I wanted my form to be sent to the page so it did not update and open% hidden%.
With script below does not let my page update, but it also does not send my form to the database:
<script>
jQuery(document).ready(function(){
jQuery('#meufrm').submit(function(){
var dados = jQuery(this).serialize();
jQuery.ajax({
type: "POST",
url: "vendas.php",
data: dados,
success: function( data )
{
if (data == "")
}
});
return false;
});
});
This other script hides my div
that works right:
<script type="text/javascript">
function mostra() {
if (document.getElementById('teste').style.display == 'block'){
document.getElementById('teste').style.display = 'none';
}else {document.getElementById('teste').style.display = 'block'}
}
</script>