Afficher un message
Vieux 31/05/2007, 18h27   #1
MV
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Bug sous IE et pas Firefox

Bonjour,

Le code suivant bugue sous internet explorer, mais pas sous firefox.


function test_champ(champ) {
// le with ci-dessous permet d'abréger
"document.forms.form1.p1.value" en "p1.value"
with (document.forms.form1) {
yo = compter(posMC) * posOR.value * 3 + compter(leadMC) *
leadOR.value * 10 + compter(notoURL) * notoOR.value * 10 ;
prix = (yo - 500) * 0.0095;
if (prix < 0) { prix = "gratis !!!"; }
total.value = yo;
tarif.value = prix;
}
}

function compter(theField)
{
var strLineCounter = 1;
for (var i = 0; i < theField.value.length; i++)
{
var strChar = theField.value.substring(i, i + 1);
if (strChar == '\n')
{
strLineCounter += 1;
}
}

return strLineCounter;
}


Ces fonction sont appelées dans le champ du formulaire : type
onblur="test_champ(this)"

Une idée ?

Merci de votre aide.

Mél.
  Réponse avec citation
 
Page generated in 0,04481 seconds with 9 queries