Hey guys,
Since the subject line has a 64 char limit (which I agree with) but the subject line in staff or the client page does not account for this, I made a mod that handles it well if you would like to use (and would like to stop getting pesky database error emails where the subject line was too long):
*Note: this was done in 1.6 ST
STEP 1 Create a .js file, name it "textlimiter.js" and paste the following in it:
function limitText(limitField, limitCount, limitNum) {
if (limitField.value.length > limitNum) {
limitField.value = limitField.value.substring(0, limitNum);
} else {
limitCount.value = limitNum - limitField.value.length;
}
}
STEP 2: for consistency, place this file in scp\js
STEP 3 find:
Subject:
">
* <?=$errors?>
in include\client\open.inc.php and replace with:
Subject:
" onKeyDown="limitText(this.form.subject,this.form.countdown,64);" onKeyUp="limitText(this.form.subject,this.form.countdown,64);" maxlength="64">
* <?=$errors?>
(Maximum characters: 64)
You have characters left.
(the extra table at the end provides better spacing with this code)
STEP 4 go to the bottom of open.inc.php and paste the following (make sure it is outside the php close bracket):
<script language='JavaScript' src='scp\js\textlimiter.js' type='text/javascript'></script>
STEP 5 find the following in include\staff\newticket.inc.php:
Subject:
" >
* <?=$errors?>
Replace with:
Subject:
" onKeyDown="limitText(this.form.subject,this.form.countdown,64);" onKeyUp="limitText(this.form.subject,this.form.countdown,64);" maxlength="64">
* <?=$errors?>
(Maximum characters: 64)
You have characters left.
(like before, added bottom table for better spacing)
STEP 6 Go to the bottom of newticket.inc.php and paste the following (make sure it is outside the php close bracket):
<script language='JavaScript' src='js\textlimiter.js' type='text/javascript'></script>
Attached are screen-shots of how this looks
Enjoy! Hope this helps someone

