ciao a tutti! Ho una funzione fatta in jQuery che dovrebbe essere chiamata dal click di un bottone. Su chrome tutto funziona alla grande. Su firefox invece, se clicco sul bottone. Non succede nulla.. :/ Sapete aiutarmi? Posto la funzione!
codice:
$(function() {
$("#bottone").click(function() {
ControllaForm()});
});
function ControllaForm(){
var name = $("#name").val();
var last = $("#last").val();
var email = $("#email").val();
var city = $("#city").val();
var day = $("#day").val();
var mese = $("#month").val();
var year = $("#year").val();
var psw = $("#psw").val();
var sex = $("#sex").val();
var dataString = 'name='+ name + '&last=' + last + '&password=' + psw + '&sex=' + sex + '&email=' + email + '&city=' + city + '&giorno=' + day + '&mese=' + mese + '&anno=' + year + '&lat=' + lat + '&long=' + long;
if(name=='' || email=='' || password=='' || sex=='' || city=='' || day=='' || mese=='' || year=='') {
$('.success').fadeOut(200).hide();
$('.error').fadeOut(200).show();
}
else
{
$.ajax({
type: "POST",
url: "register.php",
data: dataString,
success: function(msg){
$("#result").html(msg);
$("#name").val("");
$("#last").val("");
$("#email").val("");
$("#city").val("");
$("#day").val("");
$("#month").val("");
$("#year").val("");
$("#psw").val("");
$("#sex").val("");
var stampa = '<div id="sfondo_opaco"><div id="content">' + msg + '</div></div>' ;
$(stampa).insertAfter('#trapezio2').fadeIn('slow');
$(document).click( function(){
$('#sfondo_opaco').fadeOut('500').sleep(1000);
$('#content').fadeOut('500').sleep(1000);
$('#sfondo_opaco').remove();
$('#content').remove();
});
},
});
}
}