473,394 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to fill the form on another domain

nte
Hi.

I have a site where users can open their profiles and provide some
personal data.

On a user's button click, I want to open a new window and show some
page that
is hosted on another domain (I don't have any access to the code on
another domain).

Now since I already have the data necessary to fill the form on
external page, I
would like to do it with javascript instead of making the user fill
the same thing
over again.

This is what I have tried to do:
var targetWindow = window.open ('http://www.targetsite.com');

targetWindow.document.getElementById("field1").val ue = "value1";
targetWindow.document.getElementById("field2").val ue = "value2";
targetWindow.document.getElementById("Button").sub mit();
Of course, this works only when this code snippet is executed on the
same domain as the form that I want to fill (targetsite). Otherwise, I
receive
Access is denied error on the line where I want to fill field1.
How to solve this problem?

Many thanks.

Feb 2 '07 #1
2 4357
VK
On Feb 2, 7:46 pm, n...@index.hr wrote:
Hi.

I have a site where users can open their profiles and provide some
personal data.

On a user's button click, I want to open a new window and show some
page that
is hosted on another domain (I don't have any access to the code on
another domain).

Now since I already have the data necessary to fill the form on
external page, I
would like to do it with javascript instead of making the user fill
the same thing
over again.

This is what I have tried to do:

var targetWindow = window.open ('http://www.targetsite.com');

targetWindow.document.getElementById("field1").val ue = "value1";
targetWindow.document.getElementById("field2").val ue = "value2";
targetWindow.document.getElementById("Button").sub mit();

Of course, this works only when this code snippet is executed on the
same domain as the form that I want to fill (targetsite). Otherwise, I
receive
Access is denied error on the line where I want to fill field1.

How to solve this problem?
You can't.

P.S. Presumed that you cannot change default security settings on each
client machine.
Feb 2 '07 #2
Ivo
<nt*@index.hrschreef
On a user's button click, I want to open a new window and show some
page that is hosted on another domain (I don't have any access to the
code on another domain).
Now since I already have the data necessary to fill the form on
external page, I would like to do it with javascript instead of making
the user fill the same thing over again.
This is what I have tried to do:

var targetWindow = window.open ('http://www.targetsite.com');

targetWindow.document.getElementById("field1").val ue = "value1";
targetWindow.document.getElementById("field2").val ue = "value2";
targetWindow.document.getElementById("Button").sub mit();

Of course, this works only when this code snippet is executed on the
same domain as the form that I want to fill (targetsite). Otherwise, I
receive
Access is denied error on the line where I want to fill field1.
How to solve this problem?
Filling in the formfields on the page of the other site is not going to
happen. But you can look at the source, see where their form is being sent
to, and then make up a form on your own domain with fields of the same name
and send it to the same place. If their code doesn't check the address from
which the form is coming then the result will be just the same.
HTH, i.
http://4umi.com/web/javascript/

Feb 2 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: James Bender | last post by:
Hi, I am writing an application that needs to access the AD on another domain. I have a login with the access I need, and I am using the Directory Entry/Directory Searcher objects to get the...
3
by: euphorica | last post by:
I am making an inventory database. I have a field InventoryNumber where I put a specific code. The code always starts with a particular letter. I would like to fill in another field with...
4
by: C#User | last post by:
hi, For the local sql server, the connection string is like: Data Source=(local);Integrated Security=SSPI;Connection Timeout=5;DataBase=northwind But for another sql server on another domain,...
1
by: Grey | last post by:
Can I connect the SQL Server DB from another domain?? If so, is there any parameter changing in order to connect it? Million Thanks
1
by: sincethe2004 | last post by:
By using <authentication mode="Forms" > in web.config, we can create self-designed login page, but how to check user's account and password is vaild in another domain controller? Does...
1
by: Grey | last post by:
I need to use one VS.NET from one domain, DomainA, to connecting the IIS web server in another domain, DomainB. However, I got an error when I try to run the project. Error Message "Error while...
0
by: sonu | last post by:
I have following client side code which i have used in my asp.net project SummaryFeatured Resources from the IBM Business Values Solution Center WHITEPAPER : CRM Done Right Improve the...
9
by: ad | last post by:
I use the codes below to clear the cookie: HttpCookie myCookie = new HttpCookie("us_id"); myCookie.Expires = DateTime.Now.AddDays(-1d); Response.Cookies.Add(myCookie); It do well when the...
8
by: pankaj17 | last post by:
hello, Is it possible to communicate with another domain javascript function using ajax. Suppose i have a iframe and domain is different and in the iframe i have some links. If user clicks on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.