Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2007
    Posts
    85
    Plugin Contributions
    0

    Default Maximum number of characters in comment box?

    HI all,

    I'dd like to have the following, hope someone can help me out with this:

    During step 1 of the checkout, customers have the possibility to add comments/instructions in the text box. I'd like to have a restriction of, let's say, 200 characters. Preferably, I'd have a "counter" above text box, which counts down from 200 to 0, as the customer types.

    Is that possible?

    Thanks,
    Jurjen

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

    Default Re: Maximum number of characters in comment box?

    You could hack out a copy of the html in the code which already does that, from the attributes module and implement it on your checkout page.

    Partially discussed here, in reverse: http://www.zen-cart.com/forum/showthread.php?t=50075
    And you'll need to copy the appropriate jscript_xxxxx.xxx file from the product page to the appropriate checkout page.
    .

    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
    Dec 2007
    Posts
    85
    Plugin Contributions
    0

    Default Re: Maximum number of characters in comment box?

    Ok, thanks. What file should I be adding the code to? Not the Templates I guess?
    And this is the proper code?
    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;
                            }

 

 

Similar Threads

  1. v150 Maximum number of characters in an image filename??
    By kcb410 in forum General Questions
    Replies: 4
    Last Post: 1 Aug 2013, 06:18 PM
  2. Product Title Characters Maximum
    By Adambob in forum General Questions
    Replies: 1
    Last Post: 28 Mar 2011, 10:06 PM
  3. Option value maximum # of characters
    By ouxly40 in forum General Questions
    Replies: 2
    Last Post: 19 Apr 2008, 01:03 PM
  4. 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
  5. Maximum Characters for Text Box Attribute
    By MaryK in forum Bug Reports
    Replies: 1
    Last Post: 2 Apr 2007, 06:56 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