kevc978
03-06-2003, 12:18 AM
Hi All,
Ive been racking my brains for hours and tried SOOO many sites, im having a problem with a relatively old helpdesk script, the developer ditched it a year ago, and we still use it due to the amount of info it contains.
Anyway, the javascript code is as follows
<script language='JavaScript'>
function getActiveText(selectedtext) {
text = (document.all) ? document.selection.createRange().text : document.getSelection();
if (selectedtext.createTextRange) {
selectedtext.caretPos = document.selection.createRange().duplicate();
}
return true;
}
function quick(Quick) {
if (Quick != 0) {
if (document.reply.response.createTextRange && document.reply.response.caretPos) {
var caretPos = document.reply.response.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? Quick + ' ' : Quick;
} else {
document.reply.response.value+=Quick
}
document.reply.response.focus();
document.reply.quickselect.selectedIndex = 0;
}
}
</script>
Later on, we have a ListBox with the following
<textarea name='response' rows=10 cols=77 wrap=VIRTUAL onChange=getActiveText(this) onclick=getActiveText(this)
onFocus=getActiveText(this)></textarea><br>
<select onChange='quick(this.options[this.selectedIndex].value)' name='quickselect'>
<option value='0'>Quick Response</option>
<option>-----------</option>
<option value='Testing Quick Response'>Test</option>
</select></td>
I dont know whats wrong :(
Anyone help me out a little?
--
Kevin Conlin
DarkServ Technical Support Supervisor
Quality Hosting at Quality Prices
http://www.darkserv.net
Ive been racking my brains for hours and tried SOOO many sites, im having a problem with a relatively old helpdesk script, the developer ditched it a year ago, and we still use it due to the amount of info it contains.
Anyway, the javascript code is as follows
<script language='JavaScript'>
function getActiveText(selectedtext) {
text = (document.all) ? document.selection.createRange().text : document.getSelection();
if (selectedtext.createTextRange) {
selectedtext.caretPos = document.selection.createRange().duplicate();
}
return true;
}
function quick(Quick) {
if (Quick != 0) {
if (document.reply.response.createTextRange && document.reply.response.caretPos) {
var caretPos = document.reply.response.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? Quick + ' ' : Quick;
} else {
document.reply.response.value+=Quick
}
document.reply.response.focus();
document.reply.quickselect.selectedIndex = 0;
}
}
</script>
Later on, we have a ListBox with the following
<textarea name='response' rows=10 cols=77 wrap=VIRTUAL onChange=getActiveText(this) onclick=getActiveText(this)
onFocus=getActiveText(this)></textarea><br>
<select onChange='quick(this.options[this.selectedIndex].value)' name='quickselect'>
<option value='0'>Quick Response</option>
<option>-----------</option>
<option value='Testing Quick Response'>Test</option>
</select></td>
I dont know whats wrong :(
Anyone help me out a little?
--
Kevin Conlin
DarkServ Technical Support Supervisor
Quality Hosting at Quality Prices
http://www.darkserv.net