Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8455925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:24:54+00:00 2026-06-10T12:24:54+00:00

How do I make a bookmarklet that places something into a field and submits

  • 0

How do I make a bookmarklet that places something into a field and submits the form?

I think along these lines:

1)var p = document.open(http://site.com/form.htm)

2) var h = p.innerHTML

3) var f = h.getElementById(‘formfield’)

now how do I get the URL of the current page to become the value for ‘formfield’?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:24:56+00:00Added an answer on June 10, 2026 at 12:24 pm
    var p = document.open(http://site.com/form.htm)
    

    This won’t work. You may be thinking of window.open. If you use window.open, it will only be useful for your purposes if the bookmarklet is run from the same domain. If run from any other domain, it will open the window, but you won’t be able to do anything else with the document in that newly opened window.

    var h = p.innerHTML
    

    This does nothing helpful in your case. It just returns a string of text.

    var f = h.getElementById('formfield')
    

    This is not correct because it uses “h”, which isn’t correct. What you probably want is this…

    var w = window.open('http://site.com/form.htm');
    // need code that will check if window is done loading before you use next line!
    w.document.getElementById('formfield').value = window.location;
    

    If you use the bookmarklet on the page with the form, you only need this:

    document.getElementById('formfield').value = window.location;
    

    If you want to open the window to another domain, enter a form value, and submit the form – This can not be done with a bookmarklet. A bookmarklet faces the same restrictions as any other javascript in a page. This is for security to prevent any web page on the internet from trying to take control of your browser and do things on other sites as you. Your only reasonable option in this case would be to create/use a browser addon/extension.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a bookmarklet that does something similar to what Instapaper's does.
I am trying to make a bookmarklet that when clicked will check the URL
I'm trying to make a JavaScript bookmarklet that will act as a highlighter, changing
I'm creating a plugin/bookmarklet that will take an XML document embedded within the <textarea>
Here's how I make develop a bookmarklet: I write a javascript function, pass that
I am trying to make a bookmarklet that will return a user id for
I am trying to make a bookmarklet that opens a popup window. Inside this
How to make a bookmarklet where there's a div that pops up in the
I am currently trying to make a bookmarklet that adds, among other things, a
How would one make a javascript bookmarklet that transmitted all the content of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.