Maxlength of custom text fields

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
12 years 9 months ago #21185

In v1.5.2 can specify the size of a custom text field.
However, cannot specify a maxlength to stop user entering more the X characters.

Could the custom fields screen be changed please to include a Max Length parameter and the code in the hikashopText field class changed to something like:

$size = empty($field->field_options['size']) ? '' : 'size="'.intval($field->field_options['size']).'"';
$size .= empty($field->field_options['maxlength']) ? '' : ' maxlength="'.intval($field->field_options['maxlength']).'"';

Please Log in or Create an account to join the conversation.

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
12 years 9 months ago #21188

We'll add an option for that in next release.

Please Log in or Create an account to join the conversation.

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
12 years 9 months ago #21201

Great thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 14
  • Thank you received: 0
12 years 9 months ago #21221

That would be one of the good news I learned so far. It would give a bit of hint to users of the max length they could enter in a certain field. I am excited about this.

Please Log in or Create an account to join the conversation.

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
12 years 9 months ago #21233

Note that the maxlength html parameter does not display anything to the user. It just prevents him of inputing more characters.

Please Log in or Create an account to join the conversation.

Time to create page: 0.061 seconds
Powered by Kunena Forum