I have a textbox for write website url.And I place a button beside that.
I want if a user copy a url from any place and click on that button then the copied url paste in that textbox.
Now I can use ctrl+v to paste the url in the text box.But then mobile user not able to use that. So I need on click on that button the copied url paste in textbox.
Any help highly appreciable and thanks in advance.
Based upon many SO questions from the past...
... the answer is probably "No, it's impossible."
I would suggest, though, that you've skipped an important step in your development process. The problem you face is that you want to allow mobile users to painlessly enter text (in particular, URLs, which are a pain to type) from other sources into a textbox on your site. Take a step back and look at other possible solutions to that problem that don't involve Javascript access to the user's clipboard.
In fact, the 'solution' you're currently trying to implement doesn't even help the user, because the 'click to paste' button is only helpful to a mobile user if they've already succeeded in copying something to their clipboard, and if they've managed that, then presumably they already know how the native Copy/Paste functionality of their phone browser works, so they don't need your button. There are two necessary steps in the user flow you've described: copying a URL from some other source, and pasting it on your site. Even if what you're currently asking for were possible, it could only possibly help you make the second step easier for the user.
Instead, I figure you should check how copy and paste work on different available brands of smart phones and their browsers. If any of them use obscure or opaque interfaces that you worry your users may be unfamiliar with, have a button near your text box that is shown only to users of those platforms that gives them platform-targeted instructions on how to use their native copy and paste functionality.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With