Oracle's VARCHAR2 saves up to 4000 bytes of characters, and we don't want more content to save information. Therefore, when the text is uploaded, TextArea needs to be judged. The only difficulty here is that Chinese characters and other characters are mixed to make judgments.
This is a function of JS judgment to solve the above problems:
Function UpdateOne (atype) {
Var s = document.postform.content.value;
VAR n = 0;
For (i = 0; i { IF (S.Charcodeat (i)> 255) { //s.charcodeat (i) is non-ASCII character n = n 2; } else { //s.charcodeat (i) for ASCII characters n = n 1; } } Alert (n); IF (n> 4000) { Alert ("The number of words is greater than 4000, please deal with"); } Else { Document.postform.Objtype.Value = atype; Document.postform.submit (); } } Corresponding form:
......
Content: p>
p>
......
determined (trigger event)
form>