I have some javascript that takes data that is being typed into a html text area, and counts the number of characters entered on the keyup event of the textarea. I currently have set the maximum number of characters to a default value in code, ideally I need that value to be easily changed depending on who the user is.
I know that I can change the value be introducing a query string variable and examining that variable each time. However I feel that this option is unsafe as the individual user can simple alter the value at random.
I have tried to use a textarea, by setting the value in the textarea on the page load event, and then passing the name of the textarea to the javascript on the keyup event of the message textarea. However, when the javascript starts executing, I get an undefined event error. Any suggestions on how I can solve this problem.
The javascript method:
The onkeyup event of the message box:
Mike55.
I know that I can change the value be introducing a query string variable and examining that variable each time. However I feel that this option is unsafe as the individual user can simple alter the value at random.
I have tried to use a textarea, by setting the value in the textarea on the page load event, and then passing the name of the textarea to the javascript on the keyup event of the message textarea. However, when the javascript starts executing, I get an undefined event error. Any suggestions on how I can solve this problem.
The javascript method:
Code:
function limitText(limitField, limitCount, msgCount, charsCount, txtbox){
}
The onkeyup event of the message box:
Code:
onKeyUp="limitText(this.form.txtMessage,this.form.count,this.form.MsgNo,this.form.CharsLeft,this.form.sponsor);"
Mike55.