Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Mar 2007
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Multiple item (group) copy/paste selections using check boxes

    Greetings,

    I'm looking for a copy/paste function for an html page that allows a user select items (or groups of items) via a checkbox then have the ablitly to paste to a desired location with some sort of separator between each group. It will look something like what is listed in the table provided. This is for an intranet site which uses IE so clipboard is ok it needed. These are html pages so the function would be processed within the client. No access to serverside scripting. Ideally I'd like to be able to work the multiple select/copy&paste function into the script also provided below. All assistance is much appreciated.

    Thank You

    Code:
    <table width="764" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="240">Item 1: Content to be copied 1</td>
        <td width="524">&nbsp;</td>
      </tr>
      <tr>
        <td>Item 2:Content to be copied 2</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>Item 3:Content to be copied 3</td>
        <td><input type="checkbox" name="checkbox" id="checkbox" />
          Check to copy content from Items 1-3</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>Item 4:Content to be copied 4</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>Item 5:Content to be copied 5</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>Item 6:Content to be copied 6</td>
        <td><input type="checkbox" name="checkbox2" id="checkbox2" />
        Check to copy content from Items 4-6</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>Item 7:Content to be copied 7</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>Item 8:Content to be copied 8</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>Item 9:Content to be copied 9</td>
        <td><input type="checkbox" name="checkbox2" id="checkbox3" />
        Check to copy content from Items 7-9</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>Item 10:Content to be copied 10</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>Item 11:Content to be copied 11</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>Item 12:Content to be copied 12</td>
        <td><input type="checkbox" name="checkbox2" id="checkbox4" />
        Check to copy content from Items 10-12</td>
      </tr>
    </table>

    Below is the script currently in place that allow the user to copy each on individually or copy ALL... We need them to be able to select the groups they need to copy.

    Code:
    <script type="text/javascript">
    // input field descriptions
    var desc = new Array();
    
    desc['PROC_CODE'] = 'Procedure Code';
    desc['MEDICARE'] = 'Medicare Advantage';
    desc['STATUS'] = 'Procedure';
    desc['Employee_ID'] = 'Specialty';
    desc['SYS_APP'] = 'Precert Type';
    desc['SUBMITTER'] = 'Review Type';
    desc['EMAIL'] = 'Guidelines';
    desc['ADD_CPT'] = 'Additional Information for CPT';
    desc['change'] = 'Prior Change Information';
    desc['end'] = '_____________________________________________________________________________________________________________________________________';
    
    <!--------->
    desc['PROC_CODE1'] = 'Procedure Code';
    desc['MEDICARE1'] = 'Medicare Advantage';
    desc['STATUS1'] = 'Procedure';
    desc['Employee_ID1'] = 'Specialty';
    desc['SYS_APP1'] = 'Precert Type';
    desc['SUBMITTER1'] = 'Review Type';
    desc['EMAIL1'] = 'Guidelines';
    desc['ADD_CPT1'] = 'Additional Information for CPT';
    desc['end'] = '_________________________________________________';
    
    
    
    <!--------->
    desc['PROC_CODE2'] = 'Procedure Code';
    desc['MEDICARE2'] = 'Medicare Advantage';
    desc['STATUS2'] = 'Procedure';
    desc['Employee_ID2'] = 'Specialty';
    desc['SYS_APP2'] = 'Precert Type';
    desc['SUBMITTER2'] = 'Review Type';
    desc['EMAIL2'] = 'Guidelines';
    desc['ADD_CPT2'] = 'Additional Information for CPT';
    desc['change2'] = 'Prior Change Information';
    desc['end'] = '_________________________________________________';
    
    <!--------->
    desc['PROC_CODE3'] = 'Procedure Code';
    desc['MEDICARE3'] = 'Medicare Advantage';
    desc['STATUS3'] = 'Procedure';
    desc['Employee_ID3'] = 'Specialty';
    desc['SYS_APP3'] = 'Precert Type';
    desc['SUBMITTER3'] = 'Review Type';
    desc['EMAIL3'] = 'Guidelines';
    desc['ADD_CPT3'] = 'Additional Information for CPT';
    desc['change3'] = 'Prior Change Information';
    
    
    <!--------->
    desc['PROC_CODE4'] = 'Procedure Code';
    desc['MEDICARE4'] = 'Medicare Advantage';
    desc['STATUS4'] = 'Procedure';
    desc['Employee_ID4'] = 'Specialty';
    desc['SYS_APP4'] = 'Precert Type';
    desc['SUBMITTER4'] = 'Review Type';
    desc['EMAIL4'] = 'Guidelines';
    desc['ADD_CPT4'] = 'Additional Information for CPT';
    desc['change4'] = 'Prior Change Information';
    desc['end'] = '_________________________________________________';
    
    <!--------->
    desc['PROC_CODE5'] = 'Procedure Code';
    desc['MEDICARE5'] = 'Medicare Advantage';
    desc['STATUS5'] = 'Procedure';
    desc['Employee_ID5'] = 'Specialty';
    desc['SYS_APP5'] = 'Precert Type';
    desc['SUBMITTER5'] = 'Review Type';
    desc['EMAIL5'] = 'Guidelines';
    desc['ADD_CPT5'] = 'Additional Information for CPT';
    desc['change5'] = 'Prior Change Information';
    desc['end'] = '_________________________________________________';
    
    
    
    function CopyFields(){
        var copytext = '';
        for(var i = 0; i < arguments.length; i++){
            copytext += desc[arguments[i]] + ': ' + document.getElementById(arguments[i]).innerText + '\n' ;}
        var tempstore = document.getElementById(arguments[0]).innerText;
    window.clipboardData.setData('Text', copytext + '\n');}  
     
     function show(ele) {
             var srcElement = document.getElementById(ele);
             if(srcElement != null) {
    	   if(srcElement.style.display == "block" ) {
         		  srcElement.style.display= 'none';
       	    }
                else {
                       srcElement.style.display='block';
                }
                return false;
           }
    	   }</script>
    Last edited by VIPStephan; 06-10-2013 at 05:08 PM. Reason: corrected code BB tags


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •