Input Javascript IE 6.0 ok / Firefox3 non...
Javascript
-
Javascript -
Javascript -
Bonjour,
Alors voilà j'ai un ptit probleme.
Ca fait 2 JOURS que je suis là-dessus...
->Mon javascript ne marche pas sous firefox mais sous IE 6.0 oui :
Tout rentre dans la nbase de données sauf le input du javascript ('id_rnature') (et le masque de date ne fnioctionne pas)
Pourquoi s'il vous plait??
Un grand merci si vous prenez le temps de m'aidez (enfin de me sauver)
<script language="JavaScript">
var noChange=1;
function SubmitForm()
{
if(document.Form_update.Libelle.value.length < 1 ||document.Form_update.Ractif.value.length < 1)
{
alert('Formulaire Incomplet !');
}
else
{
document.Form_update.submit();
}
}
List = new Array();
function Remplir(valeur){
var sel="";
noChange=0;
sel ="<select name='Rnature' style=\"FONT-SIZE: xx-small; COLOR: #000000; width: 200px;\"";
// Parcourir le tableau
for (var i=0;i<List.length;i++)
{
// tester si la ligne du tableau (Sous-catégorie) correspond à la valeur de la catéhorie
if (List[i][1]==valeur)
{
// Ajouter une rubrique sous-catégorie au variable SEL
if (List[i][0]==<?php echo $qGet['id_rnature']?>)
{
sel= sel +"<option value="+List[i][0]+" SELECTED>"+List[i][2]+"</option>";
globale=List[i][0];
}
else
{
sel= sel +"<option value="+List[i][0]+">"+List[i][2]+"</option>";
globale=List[i][0];
}
}
}
sel =sel + "</select>";
// Modifier le DIV scat par la nouvelle List à partir du variable SEL
document.getElementById('scat').innerHTML=sel;
}
Puis dans le HTML :
<div id="scat"><?php
// $qNature="Select rnature.id, `idadefinir`, rnature.libelle from `rnature` left join `ractif` on ractif.id=rnature.idadefinir order by rnature.id" or die(mysql_error());
$qNature="Select * from `rnature`" or die(mysql_error());
$resultrnature = mysql_query($qNature);
$i=0;
/* while ($sty = mysql_fetch_array($resultrnature))
{
print "<option value=".$qGetactif['id'];
print ">".$qGetactif['libelle']."</option>";
if($i==0){$j=$qGetactif['id'];// $i=1;}
}*/
while ($sty = mysql_fetch_array ($resultrnature, MYSQL_ASSOC))
{
echo "<script language=\"Javascript\">List[$i] = new Array('".$sty['id']."','".$sty['type']."','".$sty['libelle']."');</script>";
$i=$i+1;
}
?>
<script language="JavaScript">
if(noChange==1){Remplir(<?php echo $qGet['id_ractif'];?>);}
</script>
</div><div id="scat"><?php
// $qNature="Select rnature.id, `idadefinir`, rnature.libelle from `rnature` left join `ractif` on ractif.id=rnature.idadefinir order by rnature.id" or die(mysql_error());
$qNature="Select * from `rnature`" or die(mysql_error());
$resultrnature = mysql_query($qNature);
$i=0;
/* while ($sty = mysql_fetch_array($resultrnature))
{
print "<option value=".$qGetactif['id'];
print ">".$qGetactif['libelle']."</option>";
if($i==0){$j=$qGetactif['id'];// $i=1;}
}*/
while ($sty = mysql_fetch_array ($resultrnature, MYSQL_ASSOC))
{
echo "<script language=\"Javascript\">List[$i] = new Array('".$sty['id']."','".$sty['type']."','".$sty['libelle']."');</script>";
$i=$i+1;
}
?>
<script language="JavaScript">
if(noChange==1){Remplir(<?php echo $qGet['id_ractif'];?>);}
</script>
</div>
Puis pour terminer ce rogntudjuuu de formulaire :
<input onClick='SubmitForm()' type="button" name="Submit" value="Ok" style="FONT-SIZE: xx-small; background-color:<?php print $colorbt;?>; COLOR: <?php print $colorbttx;?>; width: 45px; height: 20px"></td>
</tr>
<script language="JavaScript">
/*function RedrawForm(test, test2)
{
if(test)
{
test2.style.display = 'none';
test.style.display = 'Block';
}
}
function InitForm()
{
if(Form_update.Image_old.value != ''){
Image_old.style.display = 'block';
Image_new.style.display = 'none';
}
else{
Image_old.style.display = 'none';
Image_new.style.display = 'block';
}
if(Form_update.Fichier_old.value != ''){
Fichier_old.style.display = 'block';
Fichier_new.style.display = 'none';
}
else{
Fichier_old.style.display = 'none';
Fichier_new.style.display = 'block';
}
}
document.onload = InitForm();
*/
oDate1Mask = new Mask("dd/mm/yyyy", "date");
oDate1Mask.attach(document.Form_update.Dexpiration);
</script>
Encore merci de votre patience et de votre aide.
Alors voilà j'ai un ptit probleme.
Ca fait 2 JOURS que je suis là-dessus...
->Mon javascript ne marche pas sous firefox mais sous IE 6.0 oui :
Tout rentre dans la nbase de données sauf le input du javascript ('id_rnature') (et le masque de date ne fnioctionne pas)
Pourquoi s'il vous plait??
Un grand merci si vous prenez le temps de m'aidez (enfin de me sauver)
<script language="JavaScript">
var noChange=1;
function SubmitForm()
{
if(document.Form_update.Libelle.value.length < 1 ||document.Form_update.Ractif.value.length < 1)
{
alert('Formulaire Incomplet !');
}
else
{
document.Form_update.submit();
}
}
List = new Array();
function Remplir(valeur){
var sel="";
noChange=0;
sel ="<select name='Rnature' style=\"FONT-SIZE: xx-small; COLOR: #000000; width: 200px;\"";
// Parcourir le tableau
for (var i=0;i<List.length;i++)
{
// tester si la ligne du tableau (Sous-catégorie) correspond à la valeur de la catéhorie
if (List[i][1]==valeur)
{
// Ajouter une rubrique sous-catégorie au variable SEL
if (List[i][0]==<?php echo $qGet['id_rnature']?>)
{
sel= sel +"<option value="+List[i][0]+" SELECTED>"+List[i][2]+"</option>";
globale=List[i][0];
}
else
{
sel= sel +"<option value="+List[i][0]+">"+List[i][2]+"</option>";
globale=List[i][0];
}
}
}
sel =sel + "</select>";
// Modifier le DIV scat par la nouvelle List à partir du variable SEL
document.getElementById('scat').innerHTML=sel;
}
Puis dans le HTML :
<div id="scat"><?php
// $qNature="Select rnature.id, `idadefinir`, rnature.libelle from `rnature` left join `ractif` on ractif.id=rnature.idadefinir order by rnature.id" or die(mysql_error());
$qNature="Select * from `rnature`" or die(mysql_error());
$resultrnature = mysql_query($qNature);
$i=0;
/* while ($sty = mysql_fetch_array($resultrnature))
{
print "<option value=".$qGetactif['id'];
print ">".$qGetactif['libelle']."</option>";
if($i==0){$j=$qGetactif['id'];// $i=1;}
}*/
while ($sty = mysql_fetch_array ($resultrnature, MYSQL_ASSOC))
{
echo "<script language=\"Javascript\">List[$i] = new Array('".$sty['id']."','".$sty['type']."','".$sty['libelle']."');</script>";
$i=$i+1;
}
?>
<script language="JavaScript">
if(noChange==1){Remplir(<?php echo $qGet['id_ractif'];?>);}
</script>
</div><div id="scat"><?php
// $qNature="Select rnature.id, `idadefinir`, rnature.libelle from `rnature` left join `ractif` on ractif.id=rnature.idadefinir order by rnature.id" or die(mysql_error());
$qNature="Select * from `rnature`" or die(mysql_error());
$resultrnature = mysql_query($qNature);
$i=0;
/* while ($sty = mysql_fetch_array($resultrnature))
{
print "<option value=".$qGetactif['id'];
print ">".$qGetactif['libelle']."</option>";
if($i==0){$j=$qGetactif['id'];// $i=1;}
}*/
while ($sty = mysql_fetch_array ($resultrnature, MYSQL_ASSOC))
{
echo "<script language=\"Javascript\">List[$i] = new Array('".$sty['id']."','".$sty['type']."','".$sty['libelle']."');</script>";
$i=$i+1;
}
?>
<script language="JavaScript">
if(noChange==1){Remplir(<?php echo $qGet['id_ractif'];?>);}
</script>
</div>
Puis pour terminer ce rogntudjuuu de formulaire :
<input onClick='SubmitForm()' type="button" name="Submit" value="Ok" style="FONT-SIZE: xx-small; background-color:<?php print $colorbt;?>; COLOR: <?php print $colorbttx;?>; width: 45px; height: 20px"></td>
</tr>
<script language="JavaScript">
/*function RedrawForm(test, test2)
{
if(test)
{
test2.style.display = 'none';
test.style.display = 'Block';
}
}
function InitForm()
{
if(Form_update.Image_old.value != ''){
Image_old.style.display = 'block';
Image_new.style.display = 'none';
}
else{
Image_old.style.display = 'none';
Image_new.style.display = 'block';
}
if(Form_update.Fichier_old.value != ''){
Fichier_old.style.display = 'block';
Fichier_new.style.display = 'none';
}
else{
Fichier_old.style.display = 'none';
Fichier_new.style.display = 'block';
}
}
document.onload = InitForm();
*/
oDate1Mask = new Mask("dd/mm/yyyy", "date");
oDate1Mask.attach(document.Form_update.Dexpiration);
</script>
Encore merci de votre patience et de votre aide.
A voir également:
- Input Javascript IE 6.0 ok / Firefox3 non...
- Impossible d'ouvrir une page web malgré connexion ok ✓ - Forum Windows 8 / 8.1
- No video input enter sleep mode ✓ - Forum Matériel & Système
- Comment faire ok sur une télé sans télécommande ✓ - Forum Téléviseurs
- A javascript error occurred in the main process - Forum Matériel & Système
- Ie tab - Télécharger - Outils pour navigateurs