Jump to content

Attributes - Max Characters?


Recommended Posts

Locate the file /themes/your_theme/product.tpl, towards the very end of the file, around line 520 find the line which reads

 

{if !empty($field.name)}{$field.name}{/if}{if $field.required}<sup>*</sup>{/if}<textarea type="text" name="textField{$field.id_customization_field}" id="textField{$customizationField}" rows="1" cols="40" class="customization_block_input" />{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}</textarea>

 

and replace it with

 

{if !empty($field.name)}{$field.name}{/if}{if $field.required}<sup>*</sup>{/if}<textarea type="text" name="textField{$field.id_customization_field}" id="textField{$customizationField}" rows="1" cols="40" maxlength="12" class="customization_block_input" />{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}</textarea>

 

(we are adding maxlength attribute to textarea element)

 

This is not fool-proof; one can by-pass it either by messing with the form or the submission. A server side check should also be done but in this case it is unlikely anyone will bother.

Link to comment
Share on other sites

Locate the file /themes/your_theme/product.tpl, towards the very end of the file, around line 520 find the line which reads

 

{if !empty($field.name)}{$field.name}{/if}{if $field.required}<sup>*</sup>{/if}<textarea type="text" name="textField{$field.id_customization_field}" id="textField{$customizationField}" rows="1" cols="40" class="customization_block_input" />{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}</textarea>

 

and replace it with

 

{if !empty($field.name)}{$field.name}{/if}{if $field.required}<sup>*</sup>{/if}<textarea type="text" name="textField{$field.id_customization_field}" id="textField{$customizationField}" rows="1" cols="40" maxlength="12" class="customization_block_input" />{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}</textarea>

 

(we are adding maxlength attribute to textarea element)

 

This is not fool-proof; one can by-pass it either by messing with the form or the submission. A server side check should also be done but in this case it is unlikely anyone will bother.

 

Ive done that but im now confused as it doesnt look like its made any difference in the BO or in the shop its self

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...