0

I am trying to add character limitation on this editable div. What's the best approach I should follow?

NSString *html = [NSString stringWithFormat:@"<html><head><style>img{height:30px; width:auto;}</style></head><body style=\"background-color: transparent; padding:0; margin:0; background-image:url('%@'); background-repeat: no-repeat;\" ><div id=\"edit\" style=\"padding-top:50px; height:270px; padding-bottom:50px; padding-left:20px; padding-right:20px; \"> <div id=\"editable\" autofocus contenteditable=\"true\" style=\"font-size:25px; overflow:scroll; display:block; height:240px; \"></div></div></body></html>", imageURL];
CodaFi
  • 43,043
  • 8
  • 107
  • 153
Nikolaos Vassos
  • 246
  • 1
  • 13

1 Answers1

1

You can probably use java script with webview using,

[webView stringByEvaluatingJavaScriptFromString:@"your script"];

Here is a post helpful in restricting number of characters in editable div.

Community
  • 1
  • 1
Vignesh
  • 10,205
  • 2
  • 35
  • 73