943,162 Members | Top Members by Rank

Ad:
Dec 26th, 2009
0

copy text from Input (in popup) to Parent Window

Expand Post »
Is it possible to Copy data from a <input> box the the main windows (the input is opened in a pop-up). I've seen date-time pickers can do that, but can't find the function!
Similar Threads
Reputation Points: 7
Solved Threads: 14
Junior Poster
smartness is offline Offline
103 posts
since Aug 2007
Dec 27th, 2009
0
Re: copy text from Input (in popup) to Parent Window
http://www.webreference.com/js/tutorial1/opener.html - you can find everything on this page. but if you will have problems even after reading this just give some more details and I will help you out with the scripting
BDS
Reputation Points: 10
Solved Threads: 0
Newbie Poster
smogmaker is offline Offline
1 posts
since Dec 2009
Jan 8th, 2010
0
Re: copy text from Input (in popup) to Parent Window
I found this solution:
Im openin a with a pop-up my crop.php
and then use this button to copy values to main window
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <button onclick="javascript:window.opener.document.getElementById('pic').value='value1'; window.close();">Finish &amp; Close</button>

pic is a input box <input name="article_pic" type="text" id="article_pic" />

value1 is the new value i want to copy from this window!
Click, Copy & Close
Reputation Points: 7
Solved Threads: 14
Junior Poster
smartness is offline Offline
103 posts
since Aug 2007
Jan 28th, 2010
0
Re: copy text from Input (in popup) to Parent Window
OK now I need a little help.

I want to add content to a <textarea>

tried with: document.getElementById('text').value='SOMETHING';
but didn't work

[edit] getElementById('text').innerHTML=''; Works, but if I edit the inserted text, or delet it, then it doesn't work anymore

I nned to check If textarea has something written in it, then just add it to the end of textarea, not replace the whole content! ELSE, just add it

Thanks!
Reputation Points: 7
Solved Threads: 14
Junior Poster
smartness is offline Offline
103 posts
since Aug 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Problem To execute javascript in presence of php
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Please Help!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC