WIP update maxLength.
This commit is contained in:
parent
7575e03866
commit
5104ee4eca
2 changed files with 3 additions and 3 deletions
|
|
@ -28,12 +28,12 @@ export default {
|
|||
mounted: function () {
|
||||
const my_textarea = document.getElementById("textarea-comments");
|
||||
const remaining = document.getElementById("charactersremaining");
|
||||
const remain = 250;
|
||||
const remain = this.maxLength;
|
||||
|
||||
my_textarea.addEventListener("input", () => {
|
||||
const total = remain - my_textarea.value.length;
|
||||
const color = total < remain * 0.1 ? "red" : null; //Change text to red when the total remaining goes below 25;
|
||||
remaining.innerHTML = `${total}/250 characters remaining`;
|
||||
remaining.innerHTML = `${total}/${this.maxLength} characters remaining`;
|
||||
remaining.style.color = color;
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<textareaquestion
|
||||
cmsWidgetName="CustomerDetailsTextAreaLabelText"
|
||||
:labelText="textAreaLabelCopy"
|
||||
maxLength=250
|
||||
maxLength=50
|
||||
isRequired
|
||||
/>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Reference in a new issue