Welcome Guest, Not a member yet? Register   Sign In
maxlength in texture with newline
#1

Dear all,

I have below code for inputting text. If text contains new line, it will have problems in controller php. Can input max desc in front end.
But backend it cannot pass max length validation when there is new line. How to also check in front end which also take into consider the new line.

Code:
<textarea class="form-control" style="vertical-align: top; horizontal-align: left;
                              resize:none;" id="descriptionTextarea" name="descriptionTextarea" rows="4"  required="true"  maxlength="<?php echo DESCLENGTHINNEWPOST;?>"><?php echo set_value('descriptionTextarea'); ?></textarea>


In the controller,

Code:
$content=nl2br(htmlentities($des, ENT_QUOTES, 'UTF-8'));
if(ExceedDescLength($content, DESCLENGTHINNEWPOST)){
      // fall into this
}
Reply




Theme © iAndrew 2016 - Forum software by © MyBB