[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 236
  • Last Modified:

Autofill forms

I have a webpage that loads a form from another website in an iframe.

Is it possible to search for form labels such as "username" and autofill the input box?
0
Luv2Muff
Asked:
Luv2Muff
1 Solution
 
David S.Commented:
No. The same origin security policy prevents that.

Sometimes you can copy the page to your server (I'd use CURL with PHP) and use it to display the form instead of displaying the page from the other domain directly. When you use the copy from the same domain as your other pages, you add whatever JavaScript scripts to the page that you'd like.
0
 
scifo_dkCommented:
Well, if I understand the question correctly, you can just store the username in a session-variable. That way, you can reach it from every page on the site.

If you have a variable with the username called $username then you could say:
session_start();
$_SESSION['username'] = $username;

Open in new window


Now you can get that username on the other site like this:
session_start();
echo $_SESSION['username'];

Open in new window


More on sessions here:
http://www.tizag.com/phpT/phpsessions.php

//Scifo_dk
0
 
Mohamed AbowardaSoftware EngineerCommented:
If you want to access DOM elements inside Iframe from the parent, take a look here:
http://www.codingforums.com/showthread.php?t=29923
0
 
Luv2MuffAuthor Commented:
Thanks thanks, hope you are wee.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now