Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple textarea initialization with same class name is not happening? #42

Open
Satz007 opened this issue Nov 10, 2020 · 1 comment
Open
Labels

Comments

@Satz007
Copy link

Satz007 commented Nov 10, 2020

Multiple textarea initialization with same class name is not happening?

HTML

Feedback content* <textarea class="js-lite-editor form-control paste" maxlength="500" data-minlength="1" data-name="feedback_content" name="feedback_content" data-required="required" type="text" value=''></textarea>
Please enter Feedback content Please enter valid Feedback content
Additional content* <textarea class="js-lite-editor form-control paste" maxlength="200" data-minlength="1" data-name="additional_content" name="additional_content" data-required="required" type="text" value=''></textarea>
Please enter Additional content Please enter valid Additional content

Javascript:

window.addEventListener('DOMContentLoaded',function(){
var editor = new LiteEditor('.js-lite-editor');
});

Issue:

Only one textarea is getting initialized. other one is not initialized.

image

@uidev1116
Copy link

uidev1116 commented Jul 12, 2023

@Satz007
Sorry for late reply.
Because Multiple textarea initialization with same class name is not supported, Please initialize the number of textarea as shown in the code below.

window.addEventListener('DOMContentLoaded',function(){
  const editors = document.querySelectorAll('.js-lite-editor');
  editors.forEach((editor) => {
      new LiteEditor(editor);
  });
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants