View Full Version : copy to clipboard & navigate

05-29-2004, 02:32 PM
I want 2 buttons

one to copy the content of an inputbox
one to navigate to the url in the inputbox

let's say >>>

<input type="text" id="url" value="" />
<input type="button" id="copy" value="copy" onclick="copy" />
<input type="button" id="navigate" value="navigate" onclick="navigate" />

(for XHTML strict)

thank you !!!!

05-29-2004, 11:49 PM
Hello Castali -

I'm afraid the clipboard function only works in Internet Explorer. But the second function - assuming you mean focusing the input - should work well on all browsers.

<input type="text" id="url" value="" />
<input type="button" id="copy" value="copy" onclick="document.getElementById('url').focus(); document.getElementById('url').select(); document.execCommand('Copy');" />
<input type="button" id="navigate" value="navigate" onclick="document.getElementById('url').focus();" />

- Rex

05-30-2004, 07:01 AM
the copy works very well with IE
with navigate I mean ... go to the URL ...surf ... I don't know how to say it

but I am using Firefox and there is really no way to copy to clipboard with Mozilla browsers ?

Thank you