Author Topic: Custom Attribute Character Count and Limit  (Read 736 times)

RevoLion

  • Jr. Member
  • **
  • Posts: 67
  • Joomla Covert Operations
Custom Attribute Character Count and Limit
« on: April 12, 2012, 11:09:03 AM »
I was wondering if anyone knows how to add a character count and limit to a custom attribute box. I am developing a greeting card company website for my client and I need to put a character count and limit so that we can fit our customers messages on the greeting cards.

Or if someone can point me into the right direction in finding a code for it that I can put some where in the correct file in VirtueMart.

Thanks for any replies as I have been looking and looking for this everwhere and can not seem to find it in the VM community.

Jeremy

RevoLion

  • Jr. Member
  • **
  • Posts: 67
  • Joomla Covert Operations
Re: Custom Attribute Character Count and Limit
« Reply #1 on: April 12, 2012, 11:33:08 AM »
I think I figured out that I can adjust the character limit of that custom attribute be adjusting the field value in myphp, I just do not know which table is the correct table to find custom attributes in. I see the regular attribute database table, just not the one for custom attributes.

Thank for pointing me in the right direction,
Jeremy

RevoLion

  • Jr. Member
  • **
  • Posts: 67
  • Joomla Covert Operations
Re: Custom Attribute Character Count and Limit
« Reply #2 on: April 12, 2012, 12:06:23 PM »
I found the code, now just need to know where to put it. Maybe in the Product_attribute.php file?
Code: [Select]
<script language="javascript" type="text/javascript">
function limitText(limitField, limitCount, limitNum) {
if (limitField.value.length > limitNum) {
limitField.value = limitField.value.substring(0, limitNum);
} else {
limitCount.value = limitNum - limitField.value.length;
}
}
</script>

Thanks,
Jeremy

RevoLion

  • Jr. Member
  • **
  • Posts: 67
  • Joomla Covert Operations
Re: Custom Attribute Character Count and Limit
« Reply #3 on: May 03, 2012, 17:54:18 PM »
Does anyone know how to do this to where it is only on just one of the custom attributes not on all of them. I figured out how to get the code in the correct file, but now it applies it to all the custom attributes and not just the one I need it on.

VirtueMart Forum

Re: Custom Attribute Character Count and Limit
« Reply #3 on: May 03, 2012, 17:54:18 PM »