Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2010
    Posts
    25
    Plugin Contributions
    0

    Default [Fixed v1.5.1] Character count in text field attribute stuck

    ZEN CART 1.5.0, 1.3.9.* and 1.3.8.* (at least)

    The file includes/modules/attributes.h contains (in fact it contains it two times, but I'll try to explain with just one line):

    Code:
    $tmp_html .= '<textarea class="attribsTextarea" name="id[' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ']" rows="' . $products_options_names->fields['products_options_rows'] . '" cols="' . $products_options_names->fields['products_options_size'] . '" onkeydown="characterCount(this.form[\'' . 'id[' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ']\'],this.form.' . TEXT_REMAINING . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ',' . $products_options_names->fields['products_options_length'] . ');" onkeyup="characterCount(this.form[\'' . 'id[' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ']\'],this.form.' . TEXT_REMAINING . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ',' . $products_options_names->fields['products_options_length'] . ');" id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '" >' . stripslashes($tmp_value) .'</textarea>' . "\n";
    The error lies in the fact that somewhere in time, someone changed the actual character count of this.form.remaining to TEXT_REMAINING, and the character count gets stuck to a fixed value. Change the code to:
    Code:
    $tmp_html .= '<textarea class="attribsTextarea" name="id[' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ']" rows="' . $products_options_names->fields['products_options_rows'] . '" cols="' . $products_options_names->fields['products_options_size'] . '" onkeydown="characterCount(this.form[\'' . 'id[' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ']\'],this.form.remaining' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ',' . $products_options_names->fields['products_options_length'] . ');" onkeyup="characterCount(this.form[\'' . 'id[' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ']\'],this.form.remaining' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ',' . $products_options_names->fields['products_options_length'] . ');" id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '" >' . stripslashes($tmp_value) .'</textarea>' . "\n";
    which will solve the bug.

    This has been in the code for a long time now, hope it gets resolved.

    Greetings

    - Jarlee

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Character count in text field attribute stuck

    This would only be a bug if someone mistakenly translated the TEXT_REMAINING constant to another value.

    In english, the constant TEXT_REMAINING is defined as 'remaining' and thus the code you're suggesting to change generates output that is no different than that which you are suggesting it be changed to.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Character count in text field attribute stuck

    Changes made in v1.5.1 to address the translation issue.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. v151 Is there a way of setting text field attribute to count the characters up?
    By Bronco78th in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 24 Feb 2014, 02:40 PM
  2. Change Attribute - Product Option Name Character Count
    By sports guy in forum General Questions
    Replies: 3
    Last Post: 6 Jan 2012, 03:19 AM
  3. Having a Character Countdown with just 1 row per text field?
    By spiggles87 in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 30 Sep 2011, 02:13 PM
  4. Character encoding in text field
    By kuba1 in forum Bug Reports
    Replies: 2
    Last Post: 29 Jan 2009, 06:55 AM
  5. Lenthen Attribute character field
    By travellers in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 26 Nov 2008, 07:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR