• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Autofill HTML/JS Iframes

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

I've seem to hit a dead end but wanted to see if someone might have an answer I cannot find (if the answer exists!) I'm trying to create a script to do a simple auto fill function across an Iframe.

Long story: I will have a home made local page on the desktop of a computer. I will eventually get it where information will be added and sorted. We use a site that requires duplicate information and while copy and paste works, there is a lot of additional fields that requires copying and pasting. This would just help my day so much more.

So with that out of the way, starting from scratch. Is it possible to somehow take one page whether the index or an iframe within a page, and carry that over to another iframe with client-side scripting? No access to the server using one textbox to another?

What I do have available to use if it helps is an example here:

<input type="text" name="_name" id="_name" value="" Maxlength="1" size="1">

Short story: I need to find a way to copy contents from one text box in one iframe to another textbox in another iframe if it is possible.

Since the information does change on what needs to be entered, 3rd party software wouldn't help in this case.

I appreciate any help and will be mindful of any advice!
 
author
Posts: 297
5
Android Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not completely clear to me what you're trying to do here, but by default it is impossible for JavaScript loaded along with a page from one domain to access pages from other domains. Is this what you're trying to do? You can do Cross-document Messaging but that will require the co-operation of the target website. Your best option would probably be to bypass all the client scripting restrictions by writing a small browser extension.
 
Josh A. Smith
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Say for example if someone had a basic page for ordering widgets. Even though there are numerous 3rd party softwares out there for this situation, just stay with me here. Instead of typing in the address each time, you would want to create one Iframe window with the Widget company and another iframe window with a htm file from the desktop of your computer.

When you paste information into the textbox on your home brewed htm file, it fills the correct field on the Widget site thus preventing me from typing it in. If I had multiple addresses, I could paste into this field and later use javascript further to format the text correctly.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the iframe and the parent page are in the same domain, it is easy as



If they are not in the same domain, than Same Origin Policy gets in the way.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic