aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Parent-Child form interaction 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 "Parent-Child form interaction" Watch "Parent-Child form interaction" New topic
Author

Parent-Child form interaction

Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Hi,
I would like to achieve this using HTML and Java script.
There will be one Parent Window which will have various user informations in a table of 3 x 3,all the datas will be of static text.
For example the first column/row will have Name and Address details (say 4 lines),Upon clikcing the Edit button on this particular column,a pop window(Child Window) will appear which can used to update the Name and Address details.
After entering the data in Child window and upon clicking the submit button,the static text of the Parent window will get updated with the new data that has been entered on the child window .

Is this possible to do using HTML and Java script.
If so any link of existing site or tutorial.
PLEASE HELP ME...
Regards
[ May 13, 2002: Message edited by: Balaji Loganathan ]

Spritle Software Blogs
sowmya vasisht
Greenhorn

Joined: Oct 17, 2001
Posts: 15
refer this site it might help u...
http://javascript.internet.com/forms/items-popup-list.html
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Hi Vasisht,
Thanks for the site,I'm trying to explore it.Hope i will get answer there.
Regards
Balaji.
Originally posted by sowmya vasisht:
refer this site it might help u...
http://javascript.internet.com/forms/items-popup-list.html

[ May 13, 2002: Message edited by: Balaji Loganathan ]
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Well I started using Cookies...
I'm setting Cookies with new values in child window,then the parent will get updated with new cookie values upon forced refresh from child.
Is it Good Idea ??
Any drawback there ? Of course I will request my enduser to accept cookies.
Please comment...
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 566
You'd have to test that in different browsers, but I think that parent and child windows share the same cookie bin.


I have seen things you people would not believe, attack ships on fire off the shoulder of Orion, c-beams sparkling in the dark near the Tennhauser Gate. All these moments will be lost in time, like tears in the rain.
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Hi Adam
I'm not sure whether share the same bin,but the i can able to access the cookie from my parent window.
I decided to drop the idea of using cookies,still searching for a good solution to my problem.
Thanks for ur reply.
Regards
Balaji
Originally posted by Adam Hardy:
You'd have to test that in different browsers, but I think that parent and child windows share the same cookie bin.
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
Hi,
why don't you use
window.opener in child window to have access to parent?
so, if in parent you have function
function setRow(rowIndex, arrayOfValues),
you could use
window.opener.setRow(.....) to call this function from child
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Hi Fuksenko,
Well!! window.opener and childname.function_name() works fine for form elements,where i can transfer data from parent to child and vice versa.
But my problem is to change the static text of my parent window after getting new values from my child window.
I can't use input form elements as my form needs lots of details.Think abt a typical Invoice(its no good to put 150 text box on a single page).
Any idea ? Well I can go for servlets or JSP,but this will unneccessary make the end user to connect to internet unless he fills in all the form details,rather than fill the form,connect the Net,submit the form.
Regards
Balaji
Originally posted by Yuriy Fuksenko:
Hi,
why don't you use
window.opener in child window to have access to parent?
so, if in parent you have function
function setRow(rowIndex, arrayOfValues),
you could use
window.opener.setRow(.....) to call this function from child

[ May 14, 2002: Message edited by: Balaji Loganathan ]
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
Unless you want your parent window to be reloaded, I don't see a problem here.
Anyway, how are you going to change a static text?
You could eather change it with javascript dynamicly, and does not reload your window, or change it using a server side technology - JSP,ASP and so on - choose any of those.
If you want to go with JavaScript - you will use layes (div's, spans - whatever) - if you don't want to go with IE only. At this case you should have some function, that will rewrite layer for a given row ID with given data - something like
setRow(rowID, dataArray) - and you could call it using from your popup.
I actually prefer server side way - but as you mention, it requires a server.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Parent-Child form interaction