Forum Moderators: open

Message Too Old, No Replies

Javascript issue

Where do I post about javascript? Anyway, ......

         

Stuperfied

9:35 am on May 5, 2008 (gmt 0)

10+ Year Member



Why would this be happenning?
PS: I had to put some spaces in the tags to get them to show up.

[u r l=http://www.example.com][/u r l]
][/u r l]http://www.example.com][/u r l]
[ b ]Cat[ /b ]
[ u ]Dog[ /u ]
[ /b ]Cat[ /b ]
[ /u ]Hat[ /u ]
[ b ]Boat[ /b ]
// insert form
function insertForm($content, $linkSet, $editPage) {
?>
<script language="JavaScript">
var choix_balise = new Array(3);
for(i=0;i<3;i++) { choix_balise[i] = false;}
function mk_ajouter(textarea, ms1, ms2,x) {
var tmpstr='';
choix_balise[x]=!choix_balise[x];
tmpstr=(choix_balise[x])?ms1:ms2;
if (document.selection) {
textarea.focus();
sel = document.selection.createRange();
if (sel.text.length == 0) {
sel.text = tmpstr;
}
else {
sel.text= tmpstr += sel.text + ms2;
}
}
}
</script>
<form name="Content_Edit" method="post" action="<? echo $_SERVER['PHP_SELF'] . '?pageID=1&linkSet=' . $linkSet . '&editPage=' . $editPage; ?>">
<p>
<input name="b" type="button" Value="[b]" onClick="mk_ajouter(document.Content_Edit.textarea,'[b]','[/b]',1)">
<input name="u" type="button" Value="[u]" onClick="mk_ajouter(document.Content_Edit.textarea,'[u]','[/u]',2)">
<input name="i" type="button" Value="[i]" onClick="mk_ajouter(document.Content_Edit.textarea,'[i]','[/i]',3)">
<input name="color" type="button" Value="[color=]" onClick="mk_ajouter(document.Content_Edit.textarea,'[color=]','[/color]',4)">
<input name="size" type="button" Value="[size=]" onClick="mk_ajouter(document.Content_Edit.textarea,'[size=]','[/size]',5)">
<input name="url" type="button" Value="[url=]" onClick="mk_ajouter(document.Content_Edit.textarea,'[url=','][/url]',6)">
</p>
<p>
<textarea name="textarea" cols="90" rows="50"><?php echo $content; ?></textarea>
</p>
<p>
<input type="submit" name="Submit" value="Submit">
<input name="Reset" type="reset" id="Reset" value="Reset">
</p>
</form>

Stuperfied

9:46 am on May 5, 2008 (gmt 0)

10+ Year Member



Sorry, fixed.

sel.text= ms1 + sel.text + ms2;