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: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]

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.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to