﻿
    //custom validator check length
    function textValidate ( src, arg ) {
        if (arg.Value.length > 500)
            arg.IsValid = false;
        else
            arg.IsValid = true;     
    }

    //character countdown
    function textCounter(field,cntfield,maxlimit) {
    if (field.value.length > maxlimit) // if too long...trim it!
        field.value = field.value.substring(0, maxlimit);
        // otherwise, update 'characters left' counter
    else
        cntfield.value = maxlimit - field.value.length;
    }
