Desire Counter to Go into Negative Rather than Prevent Data Entry

Shai - August 5, 2009 - 14:41
Project:Maxlength
Version:6.x-2.0-beta1
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

I would much prefer the counter go into negative numbers than behave as it does currently, stopping any further data entry upon reaching its limit. I'd much rather the form throw an error on submit, "You need to limit the title field to 140 characters."

As a writer, it is much easier for me to edit down when I can see the whole text in front of me.

A previous version of Maxlength had the counter at "0" but still allowed further data entry. I'm sure that was deemed a big and fixed, though I preferred that to having the from stop me from further data entry.

Ideally this could be a configurable setting, but of course that's more work.

Anyway, great module, just thought I'd vote for the js tool going into negative numbers.

Shai

#1

dereine - August 5, 2009 - 16:21

Ok this would be definitive a feature, then the validation on form submit should handle the length.

#2

haleagar - November 12, 2009 - 22:31

I agree, that's what I'm looking for. Also it's the way to go with cut and paste text.

#3

haleagar - November 12, 2009 - 22:35

as I expected it's an easy fix if you need it right away.
Just comment out the following lines (10-13) in maxlength.js

//if (remainingCnt < 0) {
//  field.val(field.val().substr(0, limit));
//  remainingCnt = 0;
//}

 
 

Drupal is a registered trademark of Dries Buytaert.