Win a copy of Java Challengers this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

value from parent form to child form

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ???
 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic