aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Want to populate text box of other sites from my code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Want to populate text box of other sites from my code" Watch "Want to populate text box of other sites from my code" New topic
Author

Want to populate text box of other sites from my code

Kishan kant
Greenhorn

Joined: May 13, 2008
Posts: 4
Hi,


I have a link on myweb page[mycode] which open another site [Which is not my code].
I want to populate the textbox of second site with some message whenever a user click on link of mysite.

----------------------------------------------
what I tried:
1. Reguest parameter
e.g.
window opan("http://www.anotherDomain.com?firstname="+fName+"&lastName="+lName,"_newWin");}

Resut: Not working


-----------------------------------------------------

2.

script language="javascript"
function openWindow(){
var newWin = window opan("http://www.anotherDomain.com", "newWin");
alart("success");
newWin.document getElementBiId("fName") value=document getElementBiId("txt1") value;

}
/script
/head
body
input type="text" name="txt" id="txt1"/
a href="#" target="_blank" on_Click="javascriptopenWindow(); return false;" Click Me /a
/body
/html

Result: Not working
---------------------------------------------------------------------

3. Using ajax, modify the response and rewrite in new window
Result: message is populating but URL is gone from address bar.
---------------------------------------------------------------

What I want ?
Solution Code! using JAVA,Servlet,JSP,javascript or AJAX

What I don't want?: 'Not possible'



Thanks and Regards,
Happy Java
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"happy java ",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names get deleted.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
JavaScript has a same domain policy. If the webpage is in a different domain, it is not going to work. Only way to populate the data is to have the other site take the querystring parameter and handle it.

Eric
 
wood burning stoves
 
subject: Want to populate text box of other sites from my code