How to limit text length of text product option
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
How to limit text length of text product option
Hello,
we configured our voucher selection product to have a text type option.
If i am right the rendering is done in this file:
templates/client/html/common/partials/attribute.php
And the resulting input-Field is this:
Is it possible to limit the length of the text somehow?
Regards
nowrap
we configured our voucher selection product to have a text type option.
If i am right the rendering is done in this file:
templates/client/html/common/partials/attribute.php
And the resulting input-Field is this:
Code: Select all
<input id="select-<?= $enc->attr( $key ) ?>" class="form-control" type="text" name="<?= $enc->attr( $this->formparam( ['b_prod', 0, 'attrcustid', $id] ) ) ?>">
Regards
nowrap
Re: How to limit text length of text product option
Add a "maxlength" attribute to the input field in the template:
https://developer.mozilla.org/en-US/doc ... /maxlength
https://developer.mozilla.org/en-US/doc ... /maxlength
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: How to limit text length of text product option
I know this attribute. Maybe my question wasn't precise enough.
I hoped, that aimeos had some kind of built-in mechanismn to limit input fields and present a counter on the field.
So that it is just a configuration.
We created a small javascript function for this now as a quick solution - adding the maxlength attribute to the html input, counting chars on keyup-event and changing the label field for the input.
I hoped, that aimeos had some kind of built-in mechanismn to limit input fields and present a counter on the field.
So that it is just a configuration.
We created a small javascript function for this now as a quick solution - adding the maxlength attribute to the html input, counting chars on keyup-event and changing the label field for the input.