Résolu, oui et non ... j'ai changé de script et ça fonctionne.
[javascript]<script type="text/javascript">
function addTextchapeau(instext) {
var mess = document.modifier.chapeau;
//IE support
if (document.selection) {
mess.focus();
sel = document.selection.createRange();
sel.text = instext;
document.modifier.focus();
}
//MOZILLA/NETSCAPE support
else if (mess.selectionStart || mess.selectionStart == "0") {
var startPos = mess.selectionStart;
var endPos = mess.selectionEnd;
var chaine = mess.value;
mess.value = chaine.substring(0, startPos) + instext + chaine.substring(endPos, chaine.length);
mess.selectionStart = startPos + instext.length;
mess.selectionEnd = endPos + instext.length;
mess.focus();
} else {
mess.value += instext;
mess.focus();
}
}
<script>[/javascript]
echo "<a href='#' onclick=\"addTextchapeau('<img src=\'/".$photo['actuPhoto_rep']."/".$photo['actuPhoto_image']."\' ".$format." border=\'1\' align=\'left\' style=\'margin-right:10px\'>');return(false)\"><input value='Insérer' type='button'></a>";
Résolu, oui et non ... j'ai changé de script et ça fonctionne.
[javascript]<script type="text/javascript">
function addTextchapeau(instext) {
var mess = document.modifier.chapeau;
//IE support
if (document.selection) {
mess.focus();
sel = document.selection.createRange();
sel.text = instext;
document.modifier.focus();
}
//MOZILLA/NETSCAPE support
else if (mess.selectionStart || mess.selectionStart == "0") {
var startPos = mess.selectionStart;
var endPos = mess.selectionEnd;
var chaine = mess.value;
mess.value = chaine.substring(0, startPos) + instext + chaine.substring(endPos, chaine.length);
mess.selectionStart = startPos + instext.length;
mess.selectionEnd = endPos + instext.length;
mess.focus();
} else {
mess.value += instext;
mess.focus();
}
}
<script>[/javascript]
[php]echo "<a href='#' onclick=\"addTextchapeau('<img src=\'/".$photo['actuPhoto_rep']."/".$photo['actuPhoto_image']."\' ".$format." border=\'1\' align=\'left\' style=\'margin-right:10px\'>');return(false)\"><input value='Insérer' type='button'></a>";[/php]