Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2006
    Posts
    22
    Plugin Contributions
    0

    Default Maximum Characters for Text Box Attribute

    If I set a text attribute to have a 4 digit character maximum, say 1500, Internet Explorer will display as 1500 in the little max box above the input box, but Firefox displays as 150, which correctly reflects the length generated in the HTML:
    <input disabled="disabled" type="text" name="remainingtxt_31" size="3" maxlength="3" value="1500" /> maximum characters allowed<br /><textarea class="attribsTextarea" name="id[txt_31]" rows="3" cols="32" onkeydown="characterCount(this.form['id[txt_31]'],this.form.remainingtxt_31,1500);" onkeyup="characterCount(this.form['id[txt_31]'],this.form.remainingtxt_31,1500);" id="attrib-31-0" ></textarea>

  2. #2
    Join Date
    Jun 2006
    Posts
    22
    Plugin Contributions
    0

    Default Re: Maximum Characters for Text Box Attribute

    This is not really a bug, but a hard coded value that just behaves differently in different browsers. I worked around it by changing the hard coded limit of 3 to 4 in the two areas of the code of modules/attributes.php, and placing it in my template folder to override.

    // use text area or input box based on setting of products_options_rows in the products_options table
    if ( $products_options_names->fields['products_options_rows'] > 1) {
    $tmp_html = ' <input disabled="disabled" type="text" name="remaining' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . '" size="4" maxlength="4" in two areas of attributes.php

    I guess wishlist would be to have the field be dynamic, computed from the length of the textfield as set in the attribute, since the system seems to handle larege amounts of text very well (cross fingers).
    Thanks for a great ZenCart version

 

 

Similar Threads

  1. How to make text box attribute required and maximum length?
    By dgeere in forum Setting Up Categories, Products, Attributes
    Replies: 8
    Last Post: 20 Mar 2010, 11:10 AM
  2. Maximum number of characters in comment box?
    By jurjenruben in forum General Questions
    Replies: 2
    Last Post: 4 Apr 2008, 03:09 PM
  3. Trying to remove Maximum Characters Allowed Box
    By scitrenbaum in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 16 Jan 2008, 12:07 AM
  4. Remove 'maximum characters allowed' text
    By jeking in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 28 Nov 2007, 07:56 AM
  5. Maximum characters allowed in textarea attribute doesn't count
    By 7inter in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 27 Aug 2006, 08:45 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