Hello,

How would I be able to do an onClick to take a value from a link and put that into a form field in another form located in a different browser window with a different url?

For example:

window 1 /browser A

<a href="#" onClick="takeThisValue();">thisIsTheValueIwantToUse</a>

window 2 /browser B

(site is: www.anothersite.com) Form name is "sampleForm" and the textfield in the sampleForm I want to put it in is called "formValue".

In other words, I want to put the value "thisIsTheValueIwantToUse" from a link in window 1 / browser A and put in the text field called "formValue" in form called "sampleForm" in window 2 /browser B.

thoughts?

Thanks

No. (now waiting to be corrected:)

Do you "own/control" both sites?

So the first problem...opening a new window for another site is easy... use the window.open() javascript method.

javascript even has window.opener() to access the "parent" window that opened the "child" window. but in your case, you want to fill the form or at least one textbox in the "window".

Well, i dont see how this is possible..unless the site you are trying to open accepts values in the URL and uses those values in the form somewhere.

For example, if you were opening a web page that displays a widget. The target URL may be www.store.com/?widget=1234. And the target page uses this parameter to fill in parts of the form. Then, you can easily open the child window and send the parameter in the URL.

However, if you dont manage the target site, I dont see how you will be able to fill out any input elements.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.