Skip to main content
Notice removed Draw attention by Navarr
Bounty Ended with zhartaunik's answer chosen by Navarr
Tweeted twitter.com/#!/StackMagento/status/587673579376009216
Add additional requirement
Source Link
Navarr
  • 1.7k
  • 1
  • 17
  • 33

For a client we're exporting all the address information that goes into Magento into a third party processing system. The details about this is unimportant - but what is important is that things go terribly wrong if fields are longer than an expected amount of characters.

For this reason, we're using the API with substr in order to truncate the data down to the expected size - but this isn't really good enough. The staff using the admin panel is apparently of a decent size and can't be trained to use it correctly, so we also need to apply this limitations to the admin panel itself.

As we don't really care about them using technical know-how to get past these limitations, all we really need is a maxlength="x" on the form elements. It is a requirement that different form elements may have different maxlengths.

What is the cleanest, most upgrade-proof way to enforce a maximum length on the customer address fields in the admin panel?

My first thought was using JavaScript - but the fields don't have really predictable identifiers, so I'm not sure I can easily. Because they all use the form rendering stuff, I also can't just edit a template file by creating a custom admin theme.

Phrased another way: What's the easiest and cleanest way to add a maxlength attribute to these fields?

For a client we're exporting all the address information that goes into Magento into a third party processing system. The details about this is unimportant - but what is important is that things go terribly wrong if fields are longer than an expected amount of characters.

For this reason, we're using the API with substr in order to truncate the data down to the expected size - but this isn't really good enough. The staff using the admin panel is apparently of a decent size and can't be trained to use it correctly, so we also need to apply this limitations to the admin panel itself.

As we don't really care about them using technical know-how to get past these limitations, all we really need is a maxlength="x" on the form elements.

What is the cleanest, most upgrade-proof way to enforce a maximum length on the customer address fields in the admin panel?

My first thought was using JavaScript - but the fields don't have really predictable identifiers, so I'm not sure I can easily. Because they all use the form rendering stuff, I also can't just edit a template file by creating a custom admin theme.

Phrased another way: What's the easiest and cleanest way to add a maxlength attribute to these fields?

For a client we're exporting all the address information that goes into Magento into a third party processing system. The details about this is unimportant - but what is important is that things go terribly wrong if fields are longer than an expected amount of characters.

For this reason, we're using the API with substr in order to truncate the data down to the expected size - but this isn't really good enough. The staff using the admin panel is apparently of a decent size and can't be trained to use it correctly, so we also need to apply this limitations to the admin panel itself.

As we don't really care about them using technical know-how to get past these limitations, all we really need is a maxlength="x" on the form elements. It is a requirement that different form elements may have different maxlengths.

What is the cleanest, most upgrade-proof way to enforce a maximum length on the customer address fields in the admin panel?

My first thought was using JavaScript - but the fields don't have really predictable identifiers, so I'm not sure I can easily. Because they all use the form rendering stuff, I also can't just edit a template file by creating a custom admin theme.

Phrased another way: What's the easiest and cleanest way to add a maxlength attribute to these fields?

Notice added Draw attention by Navarr
Bounty Started worth 50 reputation by Navarr
rephrased question for improved understanding
Source Link
Navarr
  • 1.7k
  • 1
  • 17
  • 33

For a client we're exporting all the address information that goes into Magento into a third party processing system. The details about this is unimportant - but what is important is that things go terribly wrong if fields are longer than an expected amount of characters.

For this reason, we're using the API with substr in order to truncate the data down to the expected size - but this isn't really good enough. The staff using the admin panel is apparently of a decent size and can't be trained to use it correctly, so we also need to apply this limitations to the admin panel itself.

As we don't really care about them using technical know-how to get past these limitations, all we really need is a maxlength="x" on the form elements.

What is the cleanest, most upgrade-proof way to enforce a maximum length on the customer address fields in the admin panel?

My first thought was using JavaScript - but the fields don't have really predictable identifiers, so I'm not sure I can easily. Because they all use the form rendering stuff, I also can't just edit a template file by creating a custom admin theme.

Phrased another way: What's the easiest and cleanest way to add a maxlength attribute to these fields?

For a client we're exporting all the address information that goes into Magento into a third party processing system. The details about this is unimportant - but what is important is that things go terribly wrong if fields are longer than an expected amount of characters.

For this reason, we're using the API with substr in order to truncate the data down to the expected size - but this isn't really good enough. The staff using the admin panel is apparently of a decent size and can't be trained to use it correctly, so we also need to apply this limitations to the admin panel itself.

As we don't really care about them using technical know-how to get past these limitations, all we really need is a maxlength="x" on the form elements.

What is the cleanest, most upgrade-proof way to enforce a maximum length on the customer address fields in the admin panel?

My first thought was using JavaScript - but the fields don't have really predictable identifiers, so I'm not sure I can easily. Because they all use the form rendering stuff, I also can't just edit a template file by creating a custom admin theme.

For a client we're exporting all the address information that goes into Magento into a third party processing system. The details about this is unimportant - but what is important is that things go terribly wrong if fields are longer than an expected amount of characters.

For this reason, we're using the API with substr in order to truncate the data down to the expected size - but this isn't really good enough. The staff using the admin panel is apparently of a decent size and can't be trained to use it correctly, so we also need to apply this limitations to the admin panel itself.

As we don't really care about them using technical know-how to get past these limitations, all we really need is a maxlength="x" on the form elements.

What is the cleanest, most upgrade-proof way to enforce a maximum length on the customer address fields in the admin panel?

My first thought was using JavaScript - but the fields don't have really predictable identifiers, so I'm not sure I can easily. Because they all use the form rendering stuff, I also can't just edit a template file by creating a custom admin theme.

Phrased another way: What's the easiest and cleanest way to add a maxlength attribute to these fields?

Source Link
Navarr
  • 1.7k
  • 1
  • 17
  • 33

What is the cleanest way to enforce length limitations on customer's address in admin panel?

For a client we're exporting all the address information that goes into Magento into a third party processing system. The details about this is unimportant - but what is important is that things go terribly wrong if fields are longer than an expected amount of characters.

For this reason, we're using the API with substr in order to truncate the data down to the expected size - but this isn't really good enough. The staff using the admin panel is apparently of a decent size and can't be trained to use it correctly, so we also need to apply this limitations to the admin panel itself.

As we don't really care about them using technical know-how to get past these limitations, all we really need is a maxlength="x" on the form elements.

What is the cleanest, most upgrade-proof way to enforce a maximum length on the customer address fields in the admin panel?

My first thought was using JavaScript - but the fields don't have really predictable identifiers, so I'm not sure I can easily. Because they all use the form rendering stuff, I also can't just edit a template file by creating a custom admin theme.