Thread: Order Comments

Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2008
    Posts
    187
    Plugin Contributions
    0

    Default Order Comments

    Hi guys, i'm trying to put a javascript thing together to prevent people from entering more than 70 characters into the 'order comments' text box.

    i placed this code (includes/modules/pages/checkout/jscript_main.php):
    Code:
    function countAreaChars(areaName,counter,limit)
    {
    if (areaName.value.length>limit)
    areaName.value=areaName.value.substring(0,limit);
    else
    counter.value = limit - areaName.value.length;
    }
    PHP Code:
    <?php echo zen_draw_textarea_field('comments''20''3''''onKeyDown="countAreaChars(this.form.feedback,this.form.leftChars,70);" onKeyUp="countAreaChars(this.form.feedback,this.form.leftChars,70);"'); ?>
    however the javascript doesn't seem to be pulling in. Have i declared it in the wrong file?

    regards
    Andy.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Order Comments

    You could look at what's done for the Text-Attribute-Type on the product_info page, for inspiration on a way that works.
    .

    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
    Jun 2008
    Posts
    187
    Plugin Contributions
    0

    Default Re: Order Comments

    Hi Doc,

    i've looked at this page and, i think you're refering to (line 156):
    PHP Code:
        $the_button PRODUCTS_ORDER_QTY_TEXT '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit('cart.jpg'BUTTON_IN_CART_ALT); 
    however the max length attribute is not a valid textarea attribute. I think i'm just looking for help on where to deploy the javacript, as it didn't seem to work in the checkout js header.

    or have i missed understood?

    regards
    Andy.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Order Comments

    You've misunderstood my point.

    Add a textarea attribute (ie: a text attribute with the "number of lines" set to more than 1) to a sample product.
    Then visit that product's page in your store.
    You'll see the counter/restriction in effect.
    Then you can peek a the HTML and javascript for the inspiration you need.
    .

    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. v154 Searching order comments
    By perfumbg in forum Managing Customers and Orders
    Replies: 5
    Last Post: 27 May 2016, 09:46 PM
  2. Modify Order Comments
    By sports guy in forum Managing Customers and Orders
    Replies: 1
    Last Post: 7 Apr 2010, 06:08 PM
  3. My Order History and Order History Details - how do I get order comments in both?
    By trisha1581 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 29 Nov 2007, 06:37 PM
  4. order comments email
    By violetcandy in forum General Questions
    Replies: 0
    Last Post: 3 Sep 2006, 03:03 AM

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