Closed (duplicate)
Project:
MaxLength
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Apr 2009 at 15:05 UTC
Updated:
12 Mar 2011 at 20:48 UTC
I would rewrite _maxlength_format_element to remove drupal_add_js settings.
I think the bevahior of maxlength should be attached to the formelement directly.
This would have quite some advantages:
much less arguments in this function
easier to handle for other forms, comments...contact etc.
new paramater: $js = TRUE
But:
_maxlength_get_values should be remove and be there as parameter
Perhaps put the validate stuff in another validate function, perhaps could be possible to use form_set_error, not sure.
Any opinions.
Comments
Comment #1
giorgio79 commented+1
This would be fantastic.
I would be happy to test.
This would also enable this #550956: Programmatically set maxlength for given field
Comment #2
hefox commentedPatch that basically covers this in #984794: Create API for non-node forms. _maxlength_get_values is still there, but only being used to get the values to set in the element. (Duplicating this one instead of that one cause posted patch in that one XD).