Bonsoir,

J'ai fait une petite fonction de calcul sur une saisie de 6 montants : comme ceci :
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
<script language="JavaScript" type="text/javascript">
function calculeSomme(un, deux, trois, quatre, cinq, six)
{
	var somme = 0 ;
 
	un = parseFloat(un) ;
	deux = parseFloat(deux) ;
	trois = parseFloat(trois) ;
	quatre = parseFloat(quatre) ;
	cinq = parseFloat(cinq) ;
	six = parseFloat(six) ;
 
	somme = un + deux + trois + quatre + cinq + six ;
 
	document.maj.gest_points.value = somme; ;
}
</script>
code de mon formulaire de saisie :
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
24
25
26
<input type="text" name="maj_pts_logement" id="maj_pts_logement" size="5" title="Veuillez saisir un nombre de points" value="{$majeur.maj_pts_logement}" 
			onChange="calculeSomme(document.getElementById('maj_pts_logement'),document.getElementById('maj_pts_personne'),document.getElementById('maj_pts_gestion'),
								   document.getElementById('maj_pts_temps'), document.getElementById('maj_pts_new_dossier'),document.getElementById('maj_pts_hors_norme'))"
			onfocus="this.className='focus';" onblur="this.className='normal';">
			<input type="text" name="maj_pts_personne" id="maj_pts_personne" size="5" title="Veuillez saisir un nombre de points" value="{$majeur.maj_pts_personne}" 
			onChange="calculeSomme(document.getElementById('maj_pts_logement'),document.getElementById('maj_pts_personne'),document.getElementById('maj_pts_gestion'),
								   document.getElementById('maj_pts_temps'), document.getElementById('maj_pts_new_dossier'),document.getElementById('maj_pts_hors_norme'))"
			onfocus="this.className='focus';" onblur="this.className='normal';">
			<input type="text" name="maj_pts_gestion" id="maj_pts_gestion" size="5" title="Veuillez saisir un nombre de points" value="{$majeur.maj_pts_gestion}" 
			onChange="calculeSomme(document.getElementById('maj_pts_logement'),document.getElementById('maj_pts_personne'),document.getElementById('maj_pts_gestion'),
								   document.getElementById('maj_pts_temps'), document.getElementById('maj_pts_new_dossier'),document.getElementById('maj_pts_hors_norme'))"
			onfocus="this.className='focus';" onblur="this.className='normal';">
			<input type="text" name="maj_pts_temps" id="maj_pts_temps" size="5" title="Veuillez saisir un nombre de points" value="{$majeur.maj_pts_temps}" 
			onChange="calculeSomme(document.getElementById('maj_pts_logement'),document.getElementById('maj_pts_personne'),document.getElementById('maj_pts_gestion'),
								   document.getElementById('maj_pts_temps'), document.getElementById('maj_pts_new_dossier'),document.getElementById('maj_pts_hors_norme'))"
			onfocus="this.className='focus';" onblur="this.className='normal';">
			<input type="text" name="maj_pts_new_dossier" id="maj_pts_new_dossier" size="5" title="Veuillez saisir un nombre de points" value="{$majeur.maj_pts_new_dossier}" 
			onChange="calculeSomme(document.getElementById('maj_pts_logement'),document.getElementById('maj_pts_personne'),document.getElementById('maj_pts_gestion'),
								   document.getElementById('maj_pts_temps'), document.getElementById('maj_pts_new_dossier'),document.getElementById('maj_pts_hors_norme'))"
			onfocus="this.className='focus';" onblur="this.className='normal';">
			<input type="text" name="maj_pts_hors_norme" id="maj_pts_hors_norme" size="5" title="Veuillez saisir un nombre de points" value="{$majeur.maj_pts_hors_norme}" 
			onChange="calculeSomme(document.getElementById('maj_pts_logement'),document.getElementById('maj_pts_personne'),document.getElementById('maj_pts_gestion'),
								   document.getElementById('maj_pts_temps'), document.getElementById('maj_pts_new_dossier'),document.getElementById('maj_pts_hors_norme'))"
			onfocus="this.className='focus';" onblur="this.className='normal';">
			<input type="text" name="gest_points" id="point" size="5"  value="{$gest_points}" 
			onfocus="this.className='focus';" onblur="this.className='normal';">
Comme résultat, je récupère "NaN" quelque soit les nombres saisies

Je n'ai pas d'anomalie selon mon débuggueur (firebug).

Je ne vois pas l'erreur, une idée ?

Merci d'avance.