0

I've one dropdown with some values. I want to paste dropdown selected item value inside iframe textbox's.

My understanding is whenever user select dropdown item. At that time we can get selected item value and store it in one variable or clipboard. Then we can paste inside iframe. but we don't have permission to get iframe textbox's id or name or class. So without those things can we paste clipboard value?

Please advice how we can do this type of challenges.

You're answer will appreciable.

Thanks

Jatin Gadhiya
  • 1,718
  • 3
  • 20
  • 40
  • 3
    Sounds like you're trying to access a third-party iframe content. You can't, please read about [Same-origin policy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Same_origin_policy_for_JavaScript). – Teemu Oct 18 '15 at 10:25
  • Yes right its third-party. but we can able to do manually copy paste. but i want auto made. is it possible?. What we can do we can have one dropdown. and dropdown selected value we can copy in our clipboard and whenever we click on textbox inside iframe at that same time we can paste that's it. but i don't have textbox id, name and classes. please advice how we can proceed – Jatin Gadhiya Oct 18 '15 at 10:26
  • 1
    When pasting, you'd need an exact reference where to past. However, you can't get it from a third-party's page, hence not possible. – Teemu Oct 18 '15 at 10:28
  • Ok. Can you suggest me copy automated. See found one example but its promoting alert box then we can copy from alertbox manually. its not good enough for me. http://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript – Jatin Gadhiya Oct 18 '15 at 10:32
  • 1
    The problem is, that you can't automate the pasting ... – Teemu Oct 18 '15 at 10:32
  • Ok. I will do paste manual. But can you please suggest copy automate? – Jatin Gadhiya Oct 18 '15 at 10:33
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/92638/discussion-between-jatin-gadhiya-and-teemu). – Jatin Gadhiya Oct 18 '15 at 10:34
  • 1
    Please don't access user's clipboard automatically, they might loose some important information. – Teemu Oct 18 '15 at 10:34
  • No problem. this feature will not for all user or social. its only for limited. please suggest copy to clipboard automatically when dropdown item change if you have – Jatin Gadhiya Oct 18 '15 at 10:35
  • 1
    There's a [ton of these questions already](http://stackoverflow.com/search?q=[javascript]copy+to+clipboard) ; ). – Teemu Oct 18 '15 at 10:36
  • I've already tried some of this.. but its not working properly. I don't want promote and copy manually. I want whenever select item from dropdown and inside dropdown change event automated copy to clipboard that's it. – Jatin Gadhiya Oct 18 '15 at 10:39
  • Hello Teemu.. I've done automated copying..:) – Jatin Gadhiya Oct 18 '15 at 10:51

0 Answers0