Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1343 connectés 

  FORUM HardWare.fr
  Programmation
  HTML/CSS

  probleme Idframe et textearea

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

probleme Idframe et textearea

n°1355870
mitch46000
Allez c'est partie !
Posté le 28-04-2006 à 12:32:22  profilanswer
 

coucou  
 
j ai un souci avec un idframe , je vous explique....
 
je crée un formulaire en javascipt avec document.writeln(...);
dedans un tableau pour gérée o mieu mon affichage a l ecran
puis dans un idframe ( qui lui est composé d un "textarea" )je veux tester l existance ou pas de saisi de texte si c'est vide un message ALERT s'affiche... sinon rien...
MAis par magie lorsque je test ;cela ne rentre pas dedans je compren pas prkoi pourtant j ai bien affecté un "name" à mon textearea ou bien a mon "idframe" bref j ai tout testé ddans tout les sens en html php javascipt bref  pour débugé ça pue le javascript et php
 
j espere que quelqu un pourra m aider bye bon pont du 1 mai :)

mood
Publicité
Posté le 28-04-2006 à 12:32:22  profilanswer
 

n°1355877
anapajari
s/travail/glanding on hfr/gs;
Posté le 28-04-2006 à 12:42:11  profilanswer
 

Alors déjà sans le code, ça va pas être facile de t'aider...
ensuite

mitch46000 a écrit :

je crée un formulaire en javascipt avec document.writeln(...);


ça sent le code vraiment dégueu en js :o

mitch46000 a écrit :

dedans un tableau pour gérée o mieu mon affichage a l ecran


ça sent le code vraiment dégueu en html :o

mitch46000 a écrit :

puis dans un idframe ( qui lui est composé d un "textarea" )


idFrame = iframe je suppose? quel est l'interet de faire une iframe contenant juste un textarea?

mitch46000 a écrit :

pour débugé ça pue le javascript et php


Non pas quand on sait ce qu'on fait :o
D'ailleurs t'as une erreur ou pas dans la console JS (si tu es sur FF) ou un icone jaune en bas au gauche ( si tu es sur IE)
 
 

n°1357568
mitch46000
Allez c'est partie !
Posté le 02-05-2006 à 09:56:32  profilanswer
 

anapajari a écrit :

Alors déjà sans le code, ça va pas être facile de t'aider...
ensuite
 
ça sent le code vraiment dégueu en js :o
 
ça sent le code vraiment dégueu en html :o
 
idFrame = iframe je suppose? quel est l'interet de faire une iframe contenant juste un textarea?
 
Non pas quand on sait ce qu'on fait :o
D'ailleurs t'as une erreur ou pas dans la console JS (si tu es sur FF) ou un icone jaune en bas au gauche ( si tu es sur IE)


 
Je veux bien te donner le code mais c'est un code assez long dc se sera plsu chiant a lire mé plus facile a déboguer car en + j ai un fichier qui en appele un autre dc c un pe la misere voila
 
Dc si tu veux je te copie/colle sur le prochian message c no souct bye et merci  
et si tu trouve l erreur ou l oublie je te paye des frites cra ça fé 2 jrs que je bloque sur ça !!

n°1358248
mitch46000
Allez c'est partie !
Posté le 03-05-2006 à 09:01:56  profilanswer
 

Mon code est composé d une partie en javascript m affichant le tableau et l autre l'appel de du javascript autrement dit un main()...
 
 
Code de mon javascipt
 
function writeRichText(rte, html, width, height, buttons, readOnly) {
  if (allRTEs.length > 0) allRTEs += ";";
  allRTEs += rte;
  writeRTE(rte, html, width, height, buttons, readOnly);
}
 
function writeDefault(rte, html, width, height, buttons, readOnly) {
 if (!readOnly) {
  document.writeln('<textarea name="' + rte + '" id="' + rte + '" style="width: ' + width + 'px; height: ' + height + 'px;">' + html + '</textarea>');
 } else {
  document.writeln('<textarea name="' + rte + '" id="' + rte + '" style="width: ' + width + 'px; height: ' + height + 'px;" readonly>' + html + '</textarea>');
 }
}
 
 
function writeRTE(rte, html, width, height, buttons, readOnly) {
 //adjust minimum table widths
 if (isIE) {
  if (buttons && (width < 600)) width = 600;
  var tablewidth = width;
 } else {
  if (buttons && (width < 500)) width = 500;
  var tablewidth = width + 4;
 }
 
 if (buttons == true) {
  document.writeln('<h3> Formulaire Carnet de voyage</h3>');
        document.writeln('<form name="form" id="essai" enctype="multipart/form-data"    method="post">');
 
   
        document.writeln('<table class="rteBack" cellpadding=2 cellspacing=0 id="Buttons1_' + rte + '" width="' + tablewidth + '">');
 
 
  document.writeln('<tr>');
  document.writeln(' <td>Pseudo :</td>');
  document.writeln(' <td COLSPAN=2><input readonly size=35 name=pseudo_carnet_voyage value=<? echo $val_pseudo; ?>');
  document.writeln('</td>');
  document.writeln('<tr>');
  document.writeln(' <td>Titre carnet de voyage :</td>');
  document.writeln(' <td COLSPAN=2><input  size=35 name=titre_carnet_voyage></td>');
  document.writeln('</td>');
  document.writeln('</tr>');
  document.writeln('<tr>');
  document.writeln(' <td>Date de voyage  :</td>');
  document.writeln('  <td COLSPAN=2>');
  document.writeln(' <select name="jour_voyage">');
  document.writeln('    <option value="" selected>Jour </option>');
        for (i=1; i<32; i++) {
         document.writeln('   <option value=' + i + '>' + i + '</option>');
        }
  document.writeln('   </select>');
  document.writeln(' <select name="mois_voyage" >');
  document.writeln('     <option value="" selected>Mois </option>');
  document.writeln('   <option value="01">Janvier</option>');
  document.writeln('   <option value="02">Fevrier</option>');
        document.writeln('   <option value="03">Mars</option>');
  document.writeln('   <option value="04">Avril</option>');
  document.writeln('   <option value="05">Mai</option>');
  document.writeln('   <option value="06">Juin</option>');
  document.writeln('   <option value="07">Juillet</option>');
  document.writeln('   <option value="08">Aout</option>');
  document.writeln('   <option value="09">Septenbre</option>');
        document.writeln('   <option value="10">Octobre</option>');
  document.writeln('   <option value="11">Novembre</option>');
  document.writeln('   <option value="12">Decembre</option>');
  document.writeln(' </select>');
  document.writeln(' <select name="annee_voyage">');
  document.writeln('    <option value="" selected>Année </option>');
        for (i=1920; i<2007; i++) {
         document.writeln('   <option value=' + i + '>' + i + '</option>');
        }
  document.writeln(' </select>');
  document.writeln(' </td>');
  document.writeln(' </tr>');
   
  document.writeln('<tr>');
  document.writeln(' <td>Date de Publication :</td>');
  document.writeln(' <td COLSPAN=2><input readonly size=35 name=date_publication_carnet_voyage value=<? echo $date; ?>></td>');
  document.writeln('</tr>');
   document.writeln('<tr>');
  document.writeln(' <td>Photos de voyages(Max 5) :</td>');
  document.writeln(' <td> A faire + tard qd j aurais fini la gestion des images !!!</td>');
  document.writeln('</tr>');
 
  document.writeln('<tr>');
  document.writeln(' <td>Commentaires :</td>');
   
  document.writeln('  <td class=tdtitre>');
  document.writeln('   <select id="fontname_' + rte + '" onchange="Select(\'' + rte + '\', this.id)">');
  document.writeln('    <option value="Police" selected>Police</option>');
  document.writeln('    <option value="Arial, Helvetica, sans-serif">Arial</option>');
  document.writeln('    <option value="Courier New, Courier, mono">Courier New</option>');
  document.writeln('    <option value="Times New Roman, Times, serif">Times New Roman</option>');
  document.writeln('    <option value="Verdana, Arial, Helvetica, sans-serif">Verdana</option>');
  document.writeln('    <option value="comic sans ms">Comic</option>');
  document.writeln('    <option value="Tahoma">Tahoma</option>');
  document.writeln('   </select>');
 
  document.writeln('   <select unselectable="on" id="fontsize_' + rte + '" onchange="Select(\'' + rte + '\', this.id);">');
        for (i=1; i<30; i++) {
         document.writeln('   <option value=' + i + '>' + i + '</option>');
        }
  document.writeln('   </select>');
  document.writeln(' <tr>');
  document.writeln('  </td>');
 
  document.writeln('  </td>');
  document.writeln(' </tr>');
  document.writeln('</table>');
  document.writeln('<table id="Buttons2_' + rte + '" cellpadding="1" cellspacing="0">');
  document.writeln(' <tr>');
   
  document.writeln('  <td  class=tdcontenu><img class="rteImage" src="' + imagesPath + 'bold.gif" width="25" height="24" alt="Bold" title="Gras" onClick="FormatText(\'' + rte + '\', \'bold\', \'\')"></td>');
  document.writeln('  <td class=tdcontenu><img class="rteImage" src="' + imagesPath + 'italic.gif" width="25" height="24" alt="Italic" title="Italique" onClick="FormatText(\'' + rte + '\', \'italic\', \'\')"></td>');
  document.writeln('  <td class=tdcontenu><img class="rteImage" src="' + imagesPath + 'underline.gif" width="25" height="24" alt="Underline" title="Soulignage" onClick="FormatText(\'' + rte + '\', \'underline\', \'\')"></td>');
  document.writeln('  <td class=tdcontenu><img class="rteImage" src="' + imagesPath + 'left_just.gif" width="25" height="24" alt="Align Left" title="Aligné à gauche" onClick="FormatText(\'' + rte + '\', \'justifyleft\', \'\')"></td>');
  document.writeln('  <td class=tdcontenu><img class="rteImage" src="' + imagesPath + 'centre.gif" width="25" height="24" alt="Center" title="Centré" onClick="FormatText(\'' + rte + '\', \'justifycenter\', \'\')"></td>');
  document.writeln('  <td class=tdcontenu><img class="rteImage" src="' + imagesPath + 'right_just.gif" width="25" height="24" alt="Aligné à droite" title="Aligné à droite" onClick="FormatText(\'' + rte + '\', \'justifyright\', \'\')"></td>');
  document.writeln('  <td class=tdcontenu><img class="rteImage" src="' + imagesPath + 'justifyfull.gif" width="25" height="24" alt="Justify Full" title="Justifié" onclick="FormatText(\'' + rte + '\', \'justifyfull\', \'\')"></td>');
  document.writeln('  <td class=tdcontenu><img class="rteImage" src="' + imagesPath + 'hr.gif" width="25" height="24" alt="Horizontal Rule" title="Barre Horizontal" onClick="FormatText(\'' + rte + '\', \'inserthorizontalrule\', \'\')"></td>');
  document.writeln('  <td class=tdcontenu><img class="rteImage" src="' + imagesPath + 'numbered_list.gif" width="25" height="24" alt="Ordered List" title="Liste ordonnée" onClick="FormatText(\'' + rte + '\', \'insertorderedlist\', \'\')"></td>');
  document.writeln('  <td class=tdcontenu><img class="rteImage" src="' + imagesPath + 'list.gif" width="25" height="24" alt="Unordered List" title="Utilisation de puces" onClick="FormatText(\'' + rte + '\', \'insertunorderedlist\', \'\')"></td>');
  document.writeln('  <td class=tdcontenu><img class="rteImage" src="' + imagesPath + 'outdent.gif" width="25" height="24" alt="Outdent" title="Réduire le retrait" onClick="FormatText(\'' + rte + '\', \'outdent\', \'\')"></td>');
  document.writeln('  <td class=tdcontenu><img class="rteImage" src="' + imagesPath + 'indent.gif" width="25" height="24" alt="Indent" title="Augmenter le retrait" onClick="FormatText(\'' + rte + '\', \'indent\', \'\')"></td>');
  document.writeln('  <td class=tdcontenu><div id="forecolor_' + rte + '"><img class="rteImage" src="' + imagesPath + 'textcolor.gif"  alt="Text Color" title="Couleur de texte" onClick="FormatText(\'' + rte + '\', \'forecolor\', \'\')"></div></td>');
  document.writeln('  <td COLSPAN=3 ROWSPAN=1 class=tdcontenu><div id="hilitecolor_' + rte + '"><img class="rteImage" src="' + imagesPath + 'bgcolor.gif" alt="Background Color" title="Couleur de fond" onClick="FormatText(\'' + rte + '\', \'hilitecolor\', \'\')"></div></td>');
  //document.writeln('  <td class=tdcontenu><img class="rteVertSep" src="' + imagesPath + 'blackdot.gif" width="1" height="20" border="0" alt=""></td>');
 
 
        document.writeln('  <td width="100%"></td>');
  document.writeln(' </tr>');
  document.writeln('</table>');
 //}
 
    document.writeln('<iframe id="' + rte + '" name="' + rte + '" width="' + width + 'px" height="' + height + 'px"></iframe>');
 
 document.writeln('<iframe width="154" height="104" id="cp' + rte + '" src="' + includesPath + 'news/palette.htm" marginwidth="0" marginheight="0" scrolling="no" style="visibility:hidden; display: none; position: absolute;"></iframe>');
 document.writeln('<input type="hidden" id="hdn' + rte + '" name="' + rte + '" value="">');
 document.writeln('<textarea id="sc" class="textarea" name="sc" style="visibility:hidden" value=""></textarea><input type="hidden" name="posted" value="1">    <br><br><input type="submit" value="Valider"><input type="reset" value="Annuler" align="right"> <input type="hidden" value="1" name="test"></td>');
 document.getElementById('hdn' + rte).value = html;
 document.writeln ('<br>');
 document.writeln ('<br>');
 document.writeln (' <a href=/vietnampartner/maquette/index_vietnam.php>Mon compte</a><br>');
}
    enableDesignMode(rte, html, readOnly);
}
 
 
 
Code appeleant mon javascipt :
 
<html>
 
<head>
 <title>Editeur de texte</title>
 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 <script language="JavaScript" type="text/javascript" src="richtext.php"></script>
 
</head>
 
<body>
<script language="JavaScript" type="text/javascript">
<!--
<?
$content = RTESafe("Tappez votre texte ici" );
 
 
function RTESafe($strText) {
 //returns safe code for preloading in the RTE
 $tmpString = trim($strText);
     return $tmpString;
}
 
?>
 
initRTE("images/", "", "" );
//-->
 
</script>
<noscript><p><b>Vous devez accepter le javascript pour afficher correctement l'editeur</b></p></noscript>
 
<script language="JavaScript" type="text/javascript">
//Usage: writeRichText(fieldname, html, width, height, buttons)
writeRichText('rte1', '<?=$content?>', 520, 200, true, false);
 
 
</script>
 
</body>
</html>
 
Ce code est pour utiliser un "rich text editor" , j ai touver du code sur le net et essayer de le comprende (mais c'est pas evident non plus j en ai compris 60% le reste ppff....)
Le but final est de tester dans mon textarea l existance ou pas d une saisie...
Mais pour cela il faut que j affecte un nom à mon "textearea" chose que je n arrive pas a arriver.. ni a quel endroit das mon main ou ds mon javascript...
 
donc voila
 
Merci
 
 
 


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  HTML/CSS

  probleme Idframe et textearea

 

Sujets relatifs
[CSS débutant] Problème sur un boutonGros problème de formulaire
[VBS] Problème de double quote (")probleme avec la commande revoke
problème de recherche sur une tableAmélioration de la structure des tables - problème d'évolution
problème convertion image jpg en image svg avec batikprobleme d'assignation de parametres d'une map
[C# ASP.NET][Probleme] Affecter un CSSCLASS dynamiquement ?problème d'insertion
Plus de sujets relatifs à : probleme Idframe et textearea


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR