0

I have a form with a text plain long description field. Added Javascript to limit the amount of characters allowed in the field.

(function($){
    $("#edit-field-busines-0-value").attr('maxlength','500');
})(jQuery);

It works for the Authenticated users view, but not for the Admin users view? How can I have this work on the Admin view also?

5
  • Can you also post your code here? how did you add your javascript in form? – iamroald Aug 19 '16 at 18:40
  • edited the question with the simple script to limit the characters. – JBo DevMan Aug 19 '16 at 18:43
  • @iamroald not sure i follow you? js/custom.js file is added to the libraries.yml as a global styling sheet – JBo DevMan Aug 19 '16 at 18:47
  • Which libraries.yml? The one in your theme? If so, make sure you're using that theme for admin – Clive Aug 19 '16 at 18:54
  • @Clive thats what it was.... – JBo DevMan Aug 19 '16 at 19:17
0

Is it possible that this library is being pulled in by your public theme, but not by your admin theme? Authenticated users probably are maybe not seeing the edit from in the context of your admin theme, like admins are. If so, add the library to your admin theme too (you can create a sub-theme of Seven and add it there).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.