Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Aug 2004
    Posts
    767
    Plugin Contributions
    0

    Default HELP! Using Javascript to write to Orders Comments box?

    Hey guys! I need some javascript advice. This works fine under 1.5.7 but no longer with 1.5.8a.

    In 1.5.7, I had some custom buttons on my orders.php page. When I clicked the button, it would auto-populate the Comments box so I could easily send a status message to a customer without typing the same personal message.

    For example, I had a button called "24 Hours" and when I would click it, it would use an onClick Javascript command to auto-populate the comments field with a detailed message (something like, "We are currently processing your order and we expect your items to ship within the next 24 hours.").

    I did this with this simple line of code:

    Code:
    <input type="button" name="24Hours" Value="24 Hours" onclick="javascript:document.statusUpdate.comments.value='We are currently processing your order and we expect your items to ship within the next 24 hours.'">
    However, with 1.5.8, there is now a WYSIWYG editor, and I am not able to figure out how to send the onClick text to that kind of object. Can you help?

    I tried this but it's not working:

    Code:
    <input type="button" name="mybutton" Value="Test"  onclick="javascript:document.statusUpdateForm.comments.value='My example message here'">
    I see the actual form name has changed between versions (from statusUpdate to statusUpdateForm), but I don't know how to access the comments box within that object.

    If I can just figure out how to auto-populate text to the current Order Comments box with a click of a button, I can do the rest.

    Any advice on how to do this?
    - Jeff

  2. #2
    Join Date
    Aug 2004
    Posts
    767
    Plugin Contributions
    0

    Default Re: HELP! Using Javascript to write to Orders Comments box?

    UPDATE: I don't have an answer on this yet.....but in the meantime, I found this module (for 1.5.7) which I will test to see if it works on 1.5.8:

    https://www.zen-cart.com/downloads.php?do=file&id=2222
    - Jeff

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,576
    Plugin Contributions
    88

    Default Re: HELP! Using Javascript to write to Orders Comments box?

    You can always disable the WYSIWHG editor and just use TEXT.

  4. #4
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,246
    Plugin Contributions
    1

    Default Re: HELP! Using Javascript to write to Orders Comments box?

    Quote Originally Posted by Jeff_Mash View Post
    UPDATE: I don't have an answer on this yet.....but in the meantime, I found this module (for 1.5.7) which I will test to see if it works on 1.5.8:

    https://www.zen-cart.com/downloads.php?do=file&id=2222
    Yes, I successfully use this on ZC v1.5.8a - I think I had to just make a slight change after getting PHP Warnings on PHP 8.0 and another change to allow for multiple comments to be added.
    Simon

  5. #5
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,756
    Plugin Contributions
    124

    Default Re: HELP! Using Javascript to write to Orders Comments box?

    Simon, please build a new version from your changes and submit to the Plugins Library. Thank you!
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  6. #6
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,246
    Plugin Contributions
    1

    Default Re: HELP! Using Javascript to write to Orders Comments box?

    Quote Originally Posted by swguy View Post
    Simon, please build a new version from your changes and submit to the Plugins Library. Thank you!
    That'll be fun. Will do.
    Simon

  7. #7
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,756
    Plugin Contributions
    124

    Default Re: HELP! Using Javascript to write to Orders Comments box?

    Your adoption of this orphan is greatly appreciated! The community won't thrive without volunteers.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 

Similar Threads

  1. Comments on new orders?
    By harlyman in forum General Questions
    Replies: 1
    Last Post: 21 Mar 2011, 10:20 AM
  2. Using Javascript Drop-Down Box To Automatically Navigate To Product
    By Fastcar in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 13 Dec 2007, 05:41 PM
  3. Help Changing Order Comments Box to Yes/No Buttons
    By Captain Prozac in forum General Questions
    Replies: 0
    Last Post: 13 Nov 2007, 09:03 PM
  4. Printing Comments Box in Orders
    By quixotica in forum Managing Customers and Orders
    Replies: 2
    Last Post: 3 Oct 2007, 12:23 AM
  5. Prevent duplicate orders by using javascript on confirm button?
    By emtecmedia in forum General Questions
    Replies: 4
    Last Post: 5 Dec 2006, 10:59 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