Right now when an image is uploaded the post code is put at the end of the post no matter where the cursor happens to be. To be specific, it goes the the end of the post, then hits two carriage returns, and then posts the code.
I would like it to post the code where the cursor is.
Pretty sure this is the code that controls it....
If ImageFileType=true then
%>
<script>
if (opener.document.PostTopic.Message.createTextRange && opener.document.PostTopic.Message.caretPos) {
var caretPos = opener.document.PostTopic.Message.caretPos;
caretPos.text = "\n\n[img]<% =strForumURL %><% =SUBFOLDER %>/<% =filename %>[/img]";
} else {
opener.document.PostTopic.Message.value+="\n\n[img]<% =strForumURL %><% =SUBFOLDER %>/<% =filename %>[/img]";
}
</script>
<%
Else
%>
<script>
if (opener.document.PostTopic.Message.createTextRange && opener.document.PostTopic.Message.caretPos) {
var caretPos = opener.document.PostTopic.Message.caretPos;
caretPos.text = "\n\n[img]<% =strForumURL %><% =SUBFOLDER %>/<% =filename %>[/img]";
} else {
opener.document.PostTopic.Message.value+="\n\n[img]<% =strForumURL %><% =SUBFOLDER %>/<% =filename %>[/img]";
}
</script>
<%
End If
Any help would be greatly appreciated, I am very javascript challenged.