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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Bookmarklet help

    How can I make a bookmarklet, that when I press it it inserts a specified text into the selected input field?

  • #2
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    Have you went on bookmarklet page already.
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,985
    Thanks
    203
    Thanked 2,536 Times in 2,514 Posts
    Code:
    <form name = "myform">
    <input type = "text" name = "txt1" id = "txt1" size = "40"><br>
    <input type = "button" value = "Click here to insert text" onclick = "insertText()">
    </form>
    
    <script type = "text/javascript">
    function insertText() {
    var addtxt = "The text you want to insert";
    document.myform.txt1.value = document.myform.txt1.value + addtxt;
    }
    
    </script>
    Quizmaster: Name a mountain in Asia beginning with E which rises to over 29,000 feet.
    Contestant: Would it be oxygen?

  • #4
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    Haha. I should have admit that i'm confused on what "bookmarklet" suppose to be.
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • #5
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,985
    Thanks
    203
    Thanked 2,536 Times in 2,514 Posts
    Quote Originally Posted by rangana View Post
    Haha. I should have admit that i'm confused on what "bookmarklet" suppose to be.
    Yes, so is the OP!

  • #6
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I know what a bookmarklet is >: (. What I want to do is have a link in my bookmarks to insert the HTML entity for a blank space, to make blank posts in a forum that I go to often so that I don't have to manually type it. The HTML entity I'm refering to is & # 3 2 ; of course.


  •  

    Posting Permissions

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