Bonsoir.

J'ai un script de connexion ajax qui fonctionne tres bien.
Mais lorsque que je veux utiliser un bouton type image, le script merde. Est ce que quelqu'un sait pourquoi ?

formulaire :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
	  <form name="formLogon" id="formLogon" method="post">
	  	<p><label for="login">Login :</label>
	  	<input type="text" name="login" id="login" tabindex="1" maxlength="50"/></p>
		<p><label for="password">Mot de passe :</label> 
		<input type="password" name="password" id="password" tabindex="2" maxlength="25" /></p>
		<center><input type="image" src="images/Design/Navigation/buttonLogon.gif" onclick="FuncAjax('divAjax', 'check-connexion.php', 'login='+document.formLogon.login.value+'&amp;password='+document.formLogon.password.value);" name="btnFormLogon" id="btnFormLogon" tabindex="3"/></center>
	  </form>
fonction ajax

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function FuncAjax(div, page, data)
{
    if(document.all) 
    { 
        var XhrObj = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else 
    { 
        var XhrObj = new XMLHttpRequest();
    }
 
    var content = document.getElementById(div); 
 
    XhrObj.open("POST", page); 
 
    XhrObj.onreadystatechange = function() 
    { 
        if (XhrObj.readyState == 4 && XhrObj.status == 200) 
            content.innerHTML = XhrObj.responseText ; 
    }        
  	XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 
    XhrObj.send(data);
}
Merci