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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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

Want to populate text box of other sites from my code

Kishan kant

Joined: May 13, 2008
Posts: 4

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
window opan(""+fName+"&lastName="+lName,"_newWin");}

Resut: Not working



script language="javascript"
function openWindow(){
var newWin = window opan("", "newWin");
newWin.document getElementBiId("fName") value=document getElementBiId("txt1") value;

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

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

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

Joined: Nov 08, 2001
Posts: 15376
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.

I agree. Here's the link:
subject: Want to populate text box of other sites from my code
Similar Threads
URGENT: Please advise
Struts 2 / Tiles / Tiny MCE
Problem in AJAX and JSP data exchange
How to close the popup window automatically after download completes
Return string from javascript function and display in text area.