GeeCON Prague 2014*
The moose likes HTML, CSS and JavaScript and the fly likes value from parent form to child form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "value from parent form to child form" Watch "value from parent form to child form" New topic
Author

value from parent form to child form

pavan sharma
Greenhorn

Joined: Dec 19, 2006
Posts: 21
There are 2 different jsp file - and script that belong to master form.

when i click on preview button , it opens a popup window (imgpreview.jsp).

Now i want to show all input fields value from master form to imppreview.jsp page.


means how can i get value of TITLE AND ITEM_DETAILS from master form, in place of title and description in
imgpreview.jsp when clicking on preview button .

how can i ???
Subhadip Chatterjee
Ranch Hand

Joined: Dec 12, 2006
Posts: 93
Hi Pavan,
i can give you a hint on this. If i think i have got you correctly, then you want to pass parent's windows Title & some field descriptions into the child window (i.e. imagepreview.jsp). Right!!!
In that case what you do, in your parent window include a dummy form, with some name, put some hidden parameters as many as you awnt to pass to the child window. On click of "Preview", call a javascript function that sets these hidden parameters with the actual ITEM descriptions and then use the code like this:
var popup = window.open('','newwin');
document.<dummy-form-name>.target = 'newwin';
document.<dummy-form-name>.action = "<imagepreview.jsp>" or, "<whichever way you are calling the child window>";
document.<dummy-form-name>.submit();



after this opens a new window/popup, access your passed parameters, even title (if you have already set that too, into a hidden param), using JSP Expression Tags. You know that, right.


Refreshing life every moment...
pavan sharma
Greenhorn

Joined: Dec 19, 2006
Posts: 21
Hi,

Thanks for giving me new idea , but i got another way i.e simple -

i have to just write a script tag in popup window like this -

<script language="JavaScript">
document.write(opener.document.masterfrm.TITLE.value);
</script>

and in this case , no need to have a input tag. you can use it as a label.

thanks
 
GeeCON Prague 2014
 
subject: value from parent form to child form