<form name="message" method=GET action=poster.php >
<p align=center>Mise en forme du texte :
<a href="javascript:AddText('[url]','URL','[/url]');">URL</a> -
<a href="javascript:AddText('[email]','email@email.fr','[/email]');">Email</a> -
<a href="javascript:AddText('[b]','Texte en gras','[/b]');">Gras</a> -
<a href="javascript:AddText('[i]','Texte en italique','[/i]');">Italique</a> -
<a href="javascript:AddText('[u]','Texte souligné','[/u]');">Souligné</a> -
<a href="javascript:AddText('[p align=left]','gauche','[/p]');">Gauche</a> -
<a href="javascript:AddText('[p align=right]','droite','[/p]');">Droite</a> -
<a href="javascript:AddText('[p align=center]','centre','[/p]');">Centrer</a>
</p>
<script language="JavaScript" type="text/javascript">
function AddText(startTag,defaultText,endTag)
{
if (document.message.news.createTextRange) {
var text;
document.message.news.focus(document.message.news.caretPos);
document.message.news.caretPos = document.selection.createRange().duplicate();
if(document.message.news.caretPos.text.length>=0)
{
document.message.news.caretPos.text = startTag + document.message.news.caretPos.text + endTag;
}
else
{
document.message.news.caretPos.text = startTag+defaultText+endTag;
}
}
else document.message.news.value += startTag+defaultText+endTag;
}
</script>
<p align=center>
<textarea rows='12' cols=100% name=news wrap=virtual></textarea><br />
<input type="submit" name="envoyer" value="Envoyer"> - <input type=reset value=Annuler>
</p>
</form> |