Software Archive
Read-only legacy content

How to copy an element value using xdk?

Jonathan_S_
New Contributor I
447 Views

Hello, I'm trying to copy an element value, but does not works. 
This element have a link address from a web service of rss.

my code runs just  on web, but not via xdk.

here is my code:

 

var clipboard = new Clipboard('.copyone');

    clipboard.on('success', function(e) {
        alert(e);
    });

    clipboard.on('error', function(e) {
        alert(e);
    });

my html:


 

<div class="table-thing widget uib_w_76 d-margins template" data-uib="twitter%20bootstrap/text_area" data-ver="1" data-sm="-- .uib_w_74" data-sc="single" data-rpath="(base)">
                                    <label class="narrow-control label-inline">Link:</label>
                                    <textarea id="Foo" disabled="true" rows="2" class="wide-control form-control" wrap="soft">{{link}}</textarea>
                                </div>
                                <button onclick="" data-clipboard-action="copy" data-clipboard-target="#Foo" class="copyone btn widget uib_w_77 d-margins btn-default" data-uib="twitter%20bootstrap/button" data-ver="1"><i class="fa fa-copy" data-position="icon only"></i>
                                </button>


I'm using the clipboard.js library to do this event.

0 Kudos
1 Solution
Jonathan_S_
New Contributor I
447 Views

SOLVED!

it's just remove disable attribute on html side.

here: 

<textarea id="Foo" rows="2" class="wide-control form-control" wrap="soft">{{link}}</textarea>

 

View solution in original post

0 Kudos
1 Reply
Jonathan_S_
New Contributor I
448 Views

SOLVED!

it's just remove disable attribute on html side.

here: 

<textarea id="Foo" rows="2" class="wide-control form-control" wrap="soft">{{link}}</textarea>

 

0 Kudos
Reply