send data back to parent window

09-22-06, 05:01 AM
|
 |
Aspiring Coder
|
|
Join Date: Jun 2006
Posts: 537
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
send data back to parent window
I have the following form:
If someone click on "Attach files" button, a new window appear (files.php).
In files.php the user has a button called "Start".
If user click on Start I need to send a data (for exameple a text string) back to parent window. I need to see the data between HTML tags:
What I need to do ?
|

09-22-06, 06:38 AM
|
 |
Community Liaison
|
|
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
|
|
place something like this in the button:
greetz,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks
|

09-24-06, 04:17 AM
|
 |
Aspiring Coder
|
|
Join Date: Jun 2006
Posts: 537
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I explain my problem in more details. I spent many hours for a solution but no luck.
I have an HTML form to attach files. (like yahoo mail box, send an email to user and attach more files).
An important line in my form :
When I click on "Attach Files" button I see a new JavaScript window. This Javascript window has input fields to select files. Something like :
The Javascript window has a button to submit selected options.
Now I need to send the "selected file names" to parent window, and put this names in parrent window hidden fields, here:
The following JavaScript function do a test for me (Send a string to hidden field):
Now I go back to parent window. I open the HTML source in firefox, the problem is I don't see the value="" field populated.
I need to see this:
What I need to do? Please help, I appreciate any help!
Thank you very much !
|

09-24-06, 04:46 AM
|
 |
Community Liaison
|
|
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
|
|
if you want to display a user input in an input field, you'll never see what is in there, only when you display it as text on the screen, or in inputfields such as password, text and textarea, dropdown.
for example: when i change the source of an image, it will never change the source in my sourcecode, it will change it "imaginary". if you submit the parent form, you'll see that the images will be uploaded.
Greetz,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks
|

09-24-06, 05:43 AM
|
 |
Aspiring Coder
|
|
Join Date: Jun 2006
Posts: 537
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
|
if you want to display a user input in an input field, you'll never see what is in there, only when you display it as text on the screen, or in inputfields such as password, text and textarea, dropdown.
|
Yes, I know.
My script store the value in hidden input field, but I want to see the value <input type="hidden" value=" valuehere"> when I open firefox "View Sourcecode"
Yahoo do the same thing, every time the user add a new file the page is refreshed.
But I don't know how to refresh because I lost the hidden input value after refresh.
Last edited by zoliky; 09-24-06 at 05:45 AM.
|

09-24-06, 06:38 AM
|
 |
Community Liaison
|
|
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
|
|
i guess they do a form submission, and then display the inputs again.
they'll have to use php to display them back on the screen i guess.
something like this:
and then you check on the parent page whether you simply have to refresh the page, or parse the data.
Greetz,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks
|

09-24-06, 06:47 AM
|
|
Community VIP
|
|
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Again, you will never see the value of any field if you use "View Sourcecode", you will only see what the browser downloaded when requesting the page. Any changes you make to the page are stored but they do not have an effect on the source code itself.
But if you temporarily change the type of those fields to "text", you can see that they change on the page, but the sourcecode will always stay intact. That is ok since the browser does not use the sourcecode to keep track of the values of fields etc when a page is dynamically changed with scripts.
If you want to store a change on the page during a refresh, you either need to write a cookie and read it when the page loads, or send the data to the server so it can rewrite the sourcecode and make it have the changes before sending it back to the browser.
|

09-25-06, 01:17 AM
|
 |
Aspiring Coder
|
|
Join Date: Jun 2006
Posts: 537
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I put this JavaScript code
Firefox (Web Developer) plugin which has JavaScript debugging say the following:
self.opener.foo has no properties
What need to do now?
|

09-25-06, 03:49 AM
|
 |
Community Liaison
|
|
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
|
|
try:
this will submit the form, now you have to make a php, perl or asp script that will display the data that is allready filled in as a value in the inputs
Greetz,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks
|

09-25-06, 04:54 AM
|
 |
Aspiring Coder
|
|
Join Date: Jun 2006
Posts: 537
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Unrealed thanks for help ! I solve the problem
Now, the child window send the data to parent window, using this function:
In parent window source code I have this line:
OK.. now I want to open the child window again, and I want to send the value "Testing1" from parent to child window.
The child window has another hidden field:
I need to send "Testing1" from parent hidden field to chil hidden field.
Exist a way to do this without cookies or sessions?
Thank you very much !
Last edited by zoliky; 09-25-06 at 05:40 AM.
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
|
send data to email
|
jilshi |
Everything Java |
0 |
04-02-04 09:50 PM |
|