2 Replies Latest reply: Feb 6, 2013 10:21 AM by user4471490 RSS

    copying formdata to clip board

    user4471490
      Hi,

      I'm still struggling to achieve this but if someone can have a look at suggest what is wrong with the code.

      I have made one form and trying to pick up the data available on the form by pressing a copy button and want to take all the date into clip board. for an example I'm just picking one field at the moment named as p213_que_item_ref

      following code is defined as application_process getquerydet (process point ondemand)

      declare
      item_ref varchar(30);
      begin

      item_ref = :p213_que_item_ref
      HTP.prn (item_ref)

      End;

      In the header of the form querydetailsregion following code has been added

      <script language="JavaScript" type="text/javascript">
      function f_copytoCB ()
      {
      var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getqueryDet',0);
      //var get = $v('P213_QUE_ITEM_REF')
      get.add($v('P213_QUE_ITEM_REF'))
      gReturn = get.get();
      copy gReturn;
      }
      </script>

      AND in the button URL added the following code

      javascript:f_copytoCB();


      But it is still not working .......

      Any idea what is wrong with it.

      Thanks
        • 1. Re: copying formdata to clip board
          Denes Kubicek
          You should use Firebug to inspect the process while clicking the button. It will tell you what is wrong.

          Denes Kubicek
          -------------------------------------------------------------------
          http://deneskubicek.blogspot.com/
          http://www.apress.com/9781430235125
          http://apex.oracle.com/pls/apex/f?p=31517:1
          http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
          -------------------------------------------------------------------
          • 2. Re: copying formdata to clip board
            user4471490
            This is the script I have put on region header

            <script language="JavaScript" type="text/javascript">
            function f_copytoCB ()
            {
            var get = new htmldb_Get(null,&APP_ID.,&SESSION.,null,0);
            get.add('x01',$v(':P213_QUE_ITEM_REF'));
            gReturn = get.get();

            document.execCommand("copy");
            }
            </script>

            Below script I added to copy Button

            Javascript: f_copytoCB()

            But I did not get any errors but i have not got anything in the clipboard neither I received any error in dbuger

            Thanks,