At the moment, I'm working on a textarea
that allows the user to input predefined sentences. So, the user does not have to type in all those sentences.
The only thing I would like to change is, the minlength
is set to 3, that works perfectly fine for the first line in the textarea
. But of course in Line 2, it shows all entries without waiting for minlength
, because minlength=3
is true because of the text line before.
How could I reset or set back the min length in a new line of text?
JS
$("#AutoCompleteSentenceSuggestion")
.autocomplete({
minLength: 3,
source: function (request, response) {
$.getJSON("/AutoCompleteFeatures/AutoCompleteSentenceSuggestion", {
term: extractLast(request.term)
}, response);
},
focus: function () {
return false;
},
select: function (event, ui) {
var terms = split(this.value);
terms.pop();
terms.push("\u2022" + " " + ui.item.value);
terms.push("");
this.value = terms.join("\n");
return false;
}
});
Update with HTML Markup: HTML
<table class="table-textarea">
<tr>
<td class="style-class-2" rowspan="2">4</td>
<td class="style-class-3">Additional Information</td>
</tr>
<tr>
<td>
@Html.TextAreaFor(m => m.additionalInformation)
</td>
</tr>
</table>