Alright, here is what I need to do: [EDIT] What I want to do is cross-domain communication with JS, which is to the best of my knowledge, not possible unless I can configure BOTH servers to communicate with each other... in other words, this is not possible?? If anyone has a workaround, please let me know. [/EDIT] I have users of my website fill out forms, I then need to load data from certain fields from their forms into a 3rd party webform (ie. on another domain) The solution I came up with was to have a frameset, the top frame contained the user input, while the bottom frame loaded the 3rd party webform. Whenever I would click on the appropriate button/link in MY top frame (the one with the user data) it would trigger a JS function to copy that data into the appropriate field in the 3rd party form. Here is an example: $('#myButton').click(function(){ var x = $('#input_1').val(); parent.bottomFrame.document.getElementById("3rd_party_form_element_id").value = x; }) I am using jQuery to detect the click, but using an onClick= doesn't change anything... THIS WORKS BY THE WAY, but only when I'm using it to populate form data on another page that resides on my server... but I'm having problems populating the 3rd party webform. Does anyone have an idea why this is? Am I not referencing the element properly?? Big thanks and some rep to anyone who helps me solve this one! Cheers, Pete
This is most likely not possible as this can potentially be a huge security risk. Imagine you login data being sent of to another site while you were trying to login to your bank because there was second form that was collecting data. I am not completely sure about this.
XSS is not possible due to security implications. what's to stop you from: - creating a phishing page frameset that embeds the HSBC online banking login form - mail users to login and change their pass - enable some js listeners / loggers or change the login form's action page to one on your domain where you can capture the details see my point? it would break the internet totally. alas, not even for all the rep in the world--you just can't do this with a _compliant_ / mainstream browser. although... you can do it using something like greasemonkey or jetpack, i suppose...
Thanks guys... not looking to do any phishing, I'm actually looking for an easy way to cut/paste form data from my database without actually having to do the copy/paste thing for thousands of fields. I'll have to find another solution I suppose.
One possibility is to create a windows application that your users can download. This could have a web browser embedded and fille the forms out for any domain. Easy enough to do with .NET, but less convenient. Or if it's only you that needs to use it, it is probably a good option.
This is purely an administrative task, so it's only me that needs to use it... I think I'll probably look into creating a standard desktop application to do this, or maybe a browser plugin (but probably an app). Thanks to everyone for their input! Cheers, Pete.
if you need a hand let me know. I've made a few personal desktop apps that do similar, using vb and c# .net
Why not: a) Have the 2nd form read directly from the same SQL server (is there an SQL Server involved?) b) communicate via GET variables and just have the frame src adjusted to the information? frame1.src="blah.com/blah.php?username="+blah+"&information="+blah2; This normally wouldn't be too secure unless implemented correctly. But since you will be the only one using it, I don't see there being a problem. ALTERNATELY: You use PHP to connect to sockets and send the information itself. There are many eccentric ways to accomplish this task. Whether or not theyd be efficient enough is up to you.
That could work depending on the situation. If other fields need to be filled out manually then it could make it more difficult. and if some of the pages use GET and some use POST amd some are .NET with a viewstate it can complicate things. whereas if you use software to fill out the forms and submit them (simulating a regular user) it could be easier. it depends on the website(s) that the data is being submitted to. I have tried POSTing data to ASP.net websites and have yet to succeed.
seriously, building custom apps? very cool but why bother when greasemonkey - https://addons.mozilla.org/en-US/firefox/addon/748 or jetpack - https://jetpack.mozillalabs.com/ can allow you to customise whatever you want on any webpage through standard javascript. greasemonkey is soooo coool. i use it to "hack" id software's quakelive built in gamebrowser and replace it with my own version that's got a much nicer UI. i mean, when you think about - there are so many things you'd want to do to existing sites to improve them or integrate something into them. here's my favourite greasemonkey script of all time - improving and fixing google SERPS http://userscripts.org/scripts/show/9310
Well make a proxy on your domain. Create ajax request to it and make Proxy browse to the 3rd domain you want.