[Koha-bugs] [Bug 27991] New: Message field for OPAC problem reporting should have a maxlength set

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Mar 18 18:11:44 CET 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27991

            Bug ID: 27991
           Summary: Message field for OPAC problem reporting should have a
                    maxlength set
 Change sponsored?: ---
           Product: Koha
           Version: 20.05
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: OPAC
          Assignee: oleonard at myacpl.org
          Reporter: jrobb at sekls.org
        QA Contact: testopia at bugs.koha-community.org

Currently when a user is submitting a problem report via the OPAC at
opac-reportproblem.pl, they can write as much as they want in the "message"
field. When the report is submitted, only the first 255 characters are kept due
to the field size of problem_reports.content which can result in a cut off
message.

It would be good to set a maxlength for the field and also make users aware of
the limit. I'm using jQuery to set the maxlength attribute and add a character
countdown so users know exactly how much they can type.

//Problem Reporting
$(document).ready(function() {
//Enforce character limit on message field
        $('#opac-reportproblem #message').attr('maxlength', '255');
//Add character countdown
        $('#opac-reportproblem #message').after('<span
id="charcounter">255</span> characters remaining');
//Update character countdown as data is entered
        var maxLength = 255;
        $('#opac-reportproblem #message').keyup(function() {
          var length = $(this).val().length;
          var length = maxLength-length;
          $('#opac-reportproblem #charcounter').text(length);
        }); 
});

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list