Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2008
    Posts
    95
    Plugin Contributions
    0

    Default Auto populate Comments in admin order page

    Hi!

    Im trying to put few predefined comments in order page in admin like Shipping done by XX shipper etc. For that im using below given code & its working in plain test .htm file, but not in actual orders page. Unable to understand where im going wrong.

    orders.php in <head> section
    Code:
    <script type="text/JavaScript">
    
    function showText(){
    var F, opt;
    F = document.oForm;
    opt = F.commentsPopulate.options;
    
    F.comments.value = opt[opt.selectedIndex].text;
    
    }
    </script>
    orders.php in <body> section
    Code:
    <?php echo zen_draw_textarea_field('comments', 'soft', '60', '5'); ?>
    .........................................
         <select name="commentsPopulate" onchange="showText()">
            <option value="test1">test1</option>
            <option value="test2">test2</option>
            <option value="test3">test3</option>
            <option value="test4">test4</option>
        </select>
    ~Time

  2. #2

    Default Re: Auto populate Comments in admin order page

    Hi,

    This is the code you should be using

    Code:
    <script type="text/JavaScript">
    
    function showText(){
    var F, opt;
    F = document.status;
    opt = F.commentsPopulate.options;
    
    F.comments.value = opt[opt.selectedIndex].text;
    
    }
    </script>
    The form name is status and not oForm

    This would be a great idea for a plugin.
    Can you share your predefined comments list ?

 

 

Similar Threads

  1. Replies: 8
    Last Post: 7 Apr 2016, 05:13 AM
  2. Hide admin order comments from customer
    By Sudakoma in forum Customization from the Admin
    Replies: 25
    Last Post: 9 Nov 2009, 10:57 PM
  3. Auto populate contact page.
    By Tors12 in forum General Questions
    Replies: 1
    Last Post: 10 Jan 2009, 11:52 AM
  4. Order Comments not showing up in the admin
    By IllusionGuy in forum General Questions
    Replies: 0
    Last Post: 16 May 2008, 10:51 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