Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Apr 2006
    Posts
    11
    Plugin Contributions
    0

    Default Remove Max Characters Atrributes

    Ok, I have been over the forum and can't seem to find anything related to my problem. I have fixed several other problem in the process so not a total waste of time :)

    Anyways my question is, how can I remove the number of max characters allowed above the text box. See attatchment.

    I'm sure this is a fairly simple problem I just can't figure it out. Any help would be greatly appreciated.

    Thanks!
    Attached Images Attached Images  

  2. #2
    Join Date
    Mar 2006
    Posts
    208
    Plugin Contributions
    0

    Default Re: Remove Max Characters Atrributes

    includes\languages\english.php

    arround line 524 :
    define('TEXT_MAXIMUM_CHARACTERS_ALLOWED',' maximum characters allowed');

    set it to be
    define('TEXT_MAXIMUM_CHARACTERS_ALLOWED','');

    Or is it the whole display you want to disable?
    Last edited by pivey; 28 Oct 2006 at 08:45 PM.

  3. #3
    Join Date
    Apr 2006
    Posts
    11
    Plugin Contributions
    0

    Default Re: Remove Max Characters Atrributes

    That helped but I need to get rid of the little box too.

  4. #4
    Join Date
    Apr 2007
    Posts
    69
    Plugin Contributions
    0

    Default Re: Remove Max Characters Atrributes

    This thread hasn't been touched in a while, so I thought I might as well try and revive it.

    I would like to either remove the 'max number of characters allowed' box and text completely, OR I'd like to make the max number allowed infinite, because I'm assuming that would get rid of the box... but that may be a false hope.

    Is it possible to turn off the 'max number of characters' box via admin? I've been looking and can't seem to locate it.

    Thanks for any help

  5. #5
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Remove Max Characters Atrributes

    Quote Originally Posted by mellonade View Post
    Is it possible to turn off the 'max number of characters' box via admin?
    Set the number of rows to 1 for that particular attribute option, and the max-chars counter will disappear.
    .

    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.

  6. #6
    Join Date
    Apr 2007
    Posts
    69
    Plugin Contributions
    0

    Default Re: Remove Max Characters Atrributes

    Quote Originally Posted by DrByte View Post
    Set the number of rows to 1 for that particular attribute option, and the max-chars counter will disappear.
    Hmm, that does work. I'd like to have this particular text box be more than 1 row, simply to invite people to write to their heart's content. Or at least perceive that they could. Is there any way in the php to make a character amount be infinite? i know, for exapmle, in some admin options when you set things to 0 they are infinite.

  7. #7
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Remove Max Characters Atrributes

    remove the counter display for text fields with more than 1 row:

    /includes/modules/YOURTEMPLATE/attributes.php
    around line 399 you'll see code that looks like the following.
    Add the // at the beginning of the highlighted line, as shown:
    Code:
                            if ((ereg_replace('txt_', '', $key) == $products_options_names->fields['products_options_id'])) {
                              // 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="3" maxlength="3" value="' . $products_options_names->fields['products_options_length'] . '" /> ' . TEXT_MAXIMUM_CHARACTERS_ALLOWED . '<br />';
                                $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($value) .'</textarea>' . "\n";
                              } else {
                                $tmp_html = '<input type="text" name="id[' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ']" size="' . $products_options_names->fields['products_options_size'] .'" maxlength="' . $products_options_names->fields['products_options_length'] . '" value="' . stripslashes($value) .'" id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '" />  ';
                              }
                              $tmp_html .= $products_options_details;
                              break;
                            }
    And remember that you'll need to be very careful when upgrading ... to remember to redo this again.

    QUESTION: *WHY* do you want unlimited text on an attribute ? Typically the text attributes are used for product-specific notes such as custom wording to be imprinted on a t-shirt.
    What kind of "unlimited" text are you trying to collect ?

    (I don't recommend making coding changes to the attributes module such as I've shown above ... )
    .

    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.

  8. #8
    Join Date
    Apr 2007
    Posts
    69
    Plugin Contributions
    0

    Default Re: Remove Max Characters Atrributes

    Quote Originally Posted by DrByte View Post
    QUESTION: *WHY* do you want unlimited text on an attribute ? Typically the text attributes are used for product-specific notes such as custom wording to be imprinted on a t-shirt.
    What kind of "unlimited" text are you trying to collect ?
    first off, thanks for helping me out with the code; i wish i didnt have to turn to the forums every time i wanted to write my own php, but until i gain a better grasp of the language, i really appreciate your help.

    to answer your question, i want to make a text box where people can give me specific and lengthy instructions, if necessary, on designing their product. my client is selling custom-made products (hand-made books, in this case), and this one particular 'product' is actually an add-on option for other products (people can purchase gold-stamped text for their books; they can tell my client where on the book they want it; if they want the same text applied to all the books or just one, etc.)

    are there other, better ways of allowing a customer to write a note to accompany an order, specifically with one particular product? im open to any and all suggestions, this was just the first that came to mind.

    thanks again for all the help :)

  9. #9
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Remove Max Characters Atrributes

    If you're tying it to a specific product, then that attribute is likely the easiest way to directly link it.
    You get more room for storing comments when using the "comments" field on the checkout pages though ... but those comments are stored as relative to the entire order, not to a particular product.

    There are pro's and con's to each approach.

    Ultimately you can decide what works best for you and your customers.
    .

    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.

  10. #10
    Join Date
    Apr 2007
    Posts
    69
    Plugin Contributions
    0

    Default Re: Remove Max Characters Atrributes

    Quote Originally Posted by DrByte View Post
    remove the counter display for text fields with more than 1 row:

    /includes/modules/YOURTEMPLATE/attributes.php
    around line 399 you'll see code that looks like the following.
    Add the // at the beginning of the highlighted line, as shown
    // $tmp_html = ' <input disabled="disabled" type="text" name="remaining' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . '" size="3" maxlength="3" value="' . $products_options_names->fields['products_options_length'] . '" /> ' . TEXT_MAXIMUM_CHARACTERS_ALLOWED . '<br />';
    so... i just tried this (i know, a bit after the fact), and it doesn't seem to do anything. everything looks the same as before. any idea whats up?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Nickname Max characters
    By kiwi1066 in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 26 Jun 2015, 10:32 PM
  2. Text box with Max Characters set - text disappears
    By breda in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 27 Jul 2010, 01:06 PM
  3. Change Max Characters in Manufacturers Sidebox
    By KismetDesign in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 14 Nov 2009, 06:03 AM
  4. how to increase max characters for Products Model
    By keylesslocks in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 14 Oct 2008, 05:55 PM
  5. Replies: 3
    Last Post: 21 May 2008, 05:56 PM

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