Rechercher : dans
Par :

Textarea et TinyMCE WYSIWYG

Dernière réponse le 19 avr 2008 à 19:28:56 David1973, le 16 avr 2008 à 15:43:57 
 Signaler ce message aux modérateurs

Bonjour,

Voila un script qui permet d'envoyer le value d'un champ vers un textarea, mais quand je rajoute un code javascript tinyMCE WYSIWYG pour rendre mon Textarea plus jolie alors le code ne fonctionne plus.


<html>

<script>
function FoncRemplace( text, stringToFind, SRemplac, champOut )
{
var text = text.toString() ;
var maReg = new RegExp( stringToFind, "gi") ;
var resultat = text.replace( maReg, SRemplac ) ;
if ( text.search( maReg ) == -1 )
alert ( "Erreur" ) ;
else
champOut.value = resultat ;
}
function Mise_a_jours()
{
var Motif;
FoncRemplace( document.forms[0].area2.value, '#VarText1#', document.forms[0].boxNom.value, document.forms[0].area1 )
}

</script>
<FORM method="POST">
<input type="text" id="box1" name="boxNom" value="" onchange="Mise_a_jours();return false;">
<br>
<textarea name="area1" id="box2" rows="14" cols="57"></textarea>
<br>
<textarea name="area2" id="box3"  rows="14" cols="57">Bonjour, #VarText1# Comment tu vas.
</textarea>
</form>
</html>




<!-- tinyMCE -->

<!-- tinyMCE -->
<script language="javascript" type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "simple"
});
</script>
<!-- TinyMCE -->



Pouvez vous m'aidez a resoudre ce probleme SVP.

Merci d'avance
Configuration: Windows XP
Firefox 2.0.0.11

Meilleures réponses pour « Textarea et TinyMCE WYSIWYG » dans :
[Outils] Freewares pour la création de sites Voir1. Éditeurs WYSIWYG 2. Éditeurs de code 3. Client FTP 4. Graphisme et retouche d'images 5. Graphisme de style FLASH 6. Édition audio 7. Serveur web Freewares pour la création de sites Vu le nombre de demandes pour créer un site,...
[Webmaster] Choisir un bon éditeur, les éditeurs à éviter VoirIntroduction I Les éditeurs à éviter I.1 Frontpage I.2 Word I.3 Publisher II Les éditeurs recommandés II.1 Editeurs WYSIWYG II.1.1 Dreamweaver II.1.2 Web Expert II.1.3 Nvu / Kompozer II.1.4 Amaya II.2 Editeurs en mode code

1

Dacobah, le 16 avr 2008 à 17:31:46

Salut,
et oui, pour modifier la couleur d'une textarea, en regardant la doc officielle (un wiki) de MoxieCode, j'ai découvert qu'il fallait modifier le css du tiny. En gros si tu souhaite modifier le fond du tiny en jaune, il ne te reste plus qu'à aller dans le répertoire du tiny (tinymce/jscripts/tiny_mce/themes/simple/css/ ...) puis de modifier la propriété background-color de l'élément souhaité en yellow. J'ai réussi en fouillant, mais je ne suis plus sûr de quel fichier css il s'agit.

Bonne chance !

Répondre à Dacobah

2

David1973, le 16 avr 2008 à 17:44:07

Bonjour,

Excuse moi mais je ne vois pas le rapport avec mon probleme.

Il faut essayer le bout de code plus haut sans

<!-- tinyMCE -->
<script language="javascript" type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "simple"
});
</script>
<!-- TinyMCE -->


puis avec pour comprendre mieux ce que je demande.

Merci

Répondre à David1973

3

David1973, le 17 avr 2008 à 09:36:53

Bonjour,

Voila j'ai trouver la solution pour un select, mais je n'arive pas a l'adapter pour un champ.

Pouvez-vous m'aider SVP

<html>
<head>

<script language="javascript" type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "simple"
});
</script>


<FORM method="POST">

<select name="SelOpN" id="SelOpI" onChange="Op_vers_Textarea('', this.options[this.selectedIndex].value)">
<option><CENTER><strong> Cliquez ici et choisissez</strong></CENTER> </option>

<option name="OpN" title="Option titi" value="salut titi"
style="color:#000000; background-color:#66CCFF;">Option titi</option>

<option name="OpN" title="Option tata" value="salut tata"
style="color:#000000; background-color:#66CCFF;">Option tata</option>

<option name="OpN" title="Option toutou" value="salut toutou"
style="color:#000000; background-color:#66CCFF;">Option toutou</option>

<option name="OpN" title="Option toty" value="salut toty"
style="color:#000000; background-color:#66CCFF;">Option toty</option>

<option name="OpN" title="Option tati" value="salut tati"
style="color:#000000; background-color:#66CCFF;">Option tati</option>
</select>


<script language="Javascript">
function Op_vers_Textarea(did,choice)
{
text = choice.replace(/\n/g, "<br />");
tinyMCE.setContent(text);
}
</script>

<script language="Javascript">
function Champ_vers_Textarea(did,choice)
{
text = choice.replace(/\n/g, "<br />");
tinyMCE.setContent(text);
}
</script>

<input type="text" id="box1" name="boxNom" onchange="Champ_vers_Textarea();">

<textarea id="elm1" name="elm1" ROWS="10" COLS="70" >
Choisissez
</textarea>
</form>
</html>

Répondre à David1973

4

David1973, le 17 avr 2008 à 14:22:23

UP

Répondre à David1973

5

David1973, le 17 avr 2008 à 15:12:26

Bonjour,

Il y a beaucoup de personne qui cherche la solution sur d'autres forums. je pense aussi que plusieurs en essayer mais sans résultat.

Alors si vous avez une suggestions pour un autre WYSIWYG qui correspondent a ma demande je suis a l'écoute.

Merci d'avance

Répondre à David1973

6

David1973, le 18 avr 2008 à 23:37:23

UP

Répondre à David1973

7

Dacobah, le 19 avr 2008 à 14:36:35

D'autres éditeurs Wysiwyg que je te conseille :

widgEditor (http://www.themaninblue.com)
htmlArea (http://www.htmlarea.com)
FCKeditor (http://www.fckeditor.net)
Dotclear toolbar (http://www.dotclear.net)

Puisse ces éditeurs te contenter ^^

Répondre à Dacobah

8

 David1973, le 19 avr 2008 à 19:28:56

Bonjour,

Malheureusement j'ai déjà teste tous et plus encore.

Merci

Répondre à David1973