• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

value from parent form to child form

 
pavan sharma
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 93
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
pavan sharma
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic