D�sactivation input impossible.
Bonjour,
J'ai un pb sur la d�sactivation d'input.
J'affiche une fen�tre sur laquelle figure des input "cpdf" sur qui apr�s clic une fonction php est lanc�e.
Le code php converPDF.php :
Code:
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
// Traitement avant le réaffichage de la page après clic sur PDF
if ($conver == 1 && isset($_POST['fichier']))
{...
// Lance la fonction de conversion
conver_pdf($_POST['fichier'],$_POST['dos_nom']);
...}
$ret.='<form name="conversion" action="../admin/converPDF.php?dossier_id='.$dossier_id.'&conver=1" method="post">';
...
$ligne = 0;
while($entry=$d->read())
{
if ($entry <> "." && $entry <> ".." && substr($entry,strlen($entry)-4,strlen($entry)) == ".doc")
{
$fichier = $chemin."\\\\".$entry;
$ret.="<tr>";
$fic_sauv = $chemin."\\\\".substr($entry,0,strlen($entry)-4).'.pdf';
$ret.="<td width='3%' height='25'>";
$ret.="<input type='submit' name='cpdf[".$ligne."]' class='pdf' onmouseover='this.className=\"pdf_on\"' onmouseout='this.className=\"pdf\"' onclick='var c=document.getElementById(\"nbligne\").value;desactive(c);montre(\"info_conver\");document.getElementById(\"fichier\").value=\"".$fichier."\";document.getElementById(\"entry\").value=\"".$entry."\"' alt='Convertir' value=''";
$ret.="</td>";
if ($ligne%2 == 0)
$ret.="<td width='97%' height='25' class='normal12' style='background-color:#FFFFD5;border-color:#FFFFD5;' >";
else
$ret.="<td width='97%' height='25' class='normal12'>";
$ret.="<a href='javascript:ouverture_word(\"$chemin\\\\$entry\");'>$entry ".conver_base_chaine($formulaire[form_libelle]);
if (file_exists($fic_sauv))
$ret.=" ** Converti **";
$ret.="</a></td>";
$ligne++;
$ret.="<script>document.getElementById('nbligne').value='".$ligne."';</script>";
$ret.="</tr>";
}
}
$d->close();
...
$ret.='</form>'; |
La fonction js :
Code:
1 2 3 4 5 6 7 8 9 10
|
function desactive(x)
{
var i = 0;
alert('fonction desactive');
for (i=0;i<x;i++)
{
document.getElementsByName('cpdf['+i+']').disabled = true;
}
} |
Ca ne fontionne pas, les input ne sont pas d�sactiv�s.
Avez-vous une id�e ?