Jump to content

Predefined reply erases content on ticket


Patty

Recommended Posts

I tried with both Firefox 3.5 and IE 7 and the same thing happens:

 

When using a predefined reply on a ticket, when I click the link to add it to my reply everything I wrote before is erased, except the email signature. It makes it useless to use this feature. I placed the cursor after and before the text, also after the signature, but it will erase the text just the same.

 

Has anyone else notice this?

Link to comment
Share on other sites

  • WHMCS CEO

Javascript has no built in support for inserting text at the cursor point so I don't know how it could be done. If someone does, let me know but I wouldn't say predefines are useless because of it. Just predefine so it answers the entire question or load it and then modify as necessary - they're a godsend for me here.

 

Matt

Link to comment
Share on other sites

Javascript has no built in support for inserting text at the cursor point so I don't know how it could be done. If someone does, let me know but I wouldn't say predefines are useless because of it. Just predefine so it answers the entire question or load it and then modify as necessary - they're a godsend for me here.

 

Matt

Here ya go Matt, I fould this and modified it slightly. It should do what you need.

<script type="text/javascript">
{literal}
function insert(el,ins) {
window.lstText={};
   if (el.setSelectionRange){
       el.value = el.value.substring(0,el.selectionStart) + ins + el.value.substring(el.selectionStart,el.selectionEnd) + el.value.substring(el.selectionEnd,el.value.length);
   }
   else if (document.selection && document.selection.createRange) {
       el.focus();
       var range = document.selection.createRange();
       range.text = ins + range.text;
   }
}
{/literal}
</script>

<form>
<input type="button" value="hello" onclick="insert(window.lstText,'hello')">
<input type="button" value="hi" onclick="insert(window.lstText,'hi')">
<br />
<textarea rows="7" cols="30" name="txt1" onfocus="window.lstText=this;">
This is sample text, click anywhere in here then
choose on of the buttons above to see text inserted.
</textarea>
<textarea rows="7" cols="30" name="txt2" onfocus="window.lstText=this;">
This is sample text, click anywhere in here then
choose on of the buttons above to see text inserted.
</textarea>
</form>

Link to comment
Share on other sites

  • 3 months later...

I want to also say that inserting at the cursor would be GREAT - we have a lot of tickets where they ask a couple questions and we don't want to open new tickets for each one, so inserting multiple replies or links would be smashing!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated