Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Feb 2004
    Location
    Earth
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts

    copy to clipboard & navigate

    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="180.140.256.27" />
    <input type="button" id="copy" value="copy" onclick="copy" />
    <input type="button" id="navigate" value="navigate" onclick="navigate" />


    (for XHTML strict)

    thank you !!!!

  • #2
    Rex
    Rex is offline
    New Coder
    Join Date
    May 2004
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Code:
    <input type="text" id="url" value="180.140.256.27" />
    <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
    Sincerely,
    Rex

  • #3
    Regular Coder
    Join Date
    Feb 2004
    Location
    Earth
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Last edited by castali; 05-30-2004 at 07:07 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •