extranet/www/js/kbis.js

56 lines
1.2 KiB
JavaScript
Raw Normal View History

2010-07-12 10:16:28 +00:00
var pct = 0;
var prec = 0;
2010-08-03 09:19:20 +00:00
var checkInterval = 10;
2010-07-12 10:16:28 +00:00
var url = '';
function checkKbis(start)
{
if(start>=1){
$.post( 'pages/kbis2.php', {
ajax: 'true', start: start, siret: siren },
function (data, textStatus) { url = data; }
);
}else{
$.post( 'pages/kbis2.php', {
ajax: 'true', start: 0, url: url, siret: siren },
function (data, textStatus) {
if( data!='' && data!='FALSE' ){ updateKbisInfo(data); }
}
);
}
}
2010-08-03 09:19:20 +00:00
function updateKbis(){
$('#progressbar').reportprogress(++pct);
if(pct==100){
2010-07-09 07:46:43 +00:00
updateKbisInfo(message);
pct=0;
}
2010-08-03 09:19:20 +00:00
if( Math.floor(pct/checkInterval)!=prec || pct==1 ){
prec = Math.floor(pct/checkInterval);
checkKbis(false);
}
}
function updateKbisInfo(html){
$('#result').html(html);
clearInterval(holdTheInterval);
}
2010-08-03 09:19:20 +00:00
$(document).ready(function(){
$('input[type=checkbox][name=sendmail]').live('click', function(){
if($(this).attr('checked')== true){
$('#formMail').css('display', 'block');
}else{
$('#formMail').css('display', 'none');
}
});
$('form[name=mailkbis]').submit(function(){
var eMail = $('input[name=mail]').val();
if(!checkEmail(eMail)){
alert('Veuillez saisir une adresse email.');
return false;
} else { return true; }
});
});