Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to implement this in DHTML

 
sarah Marsh
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello:

There's two pages. On first page there's text field and a button,
when click on the button, it goes to the second page. On second page it shows the data retrived from the database, besides each data there's a radio button, when double clike on any radio button,it goes back to the first page and get the text field populated by that checked value on second page.

Any example for this? which parts do I need to read in DHTML? Any websites?

Thanks a lot!
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should not need DHTML/JavaScript to do this, you should do this all of the server side sice all you are dealing with is form submissions and yanking information from a databse which JavaScript can not do.

Eric
 
sarah Marsh
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The second page already access the database. So the first page just get the data from the second page. It's required to use DHTML, please help!
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless the second window is a pop up window, you are not able to pass the data to the first window.
 
sarah Marsh
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the second page is a pop up window. Any example for this?

Thanks!
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the pop up window
window.opener.document.FormName.ElementName.value = "blah";


That is how you would pass a value back to a parent window form element
 
sarah Marsh
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you,Eric.

How does the text field of the first page get the value from second page?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
by executing the statement from above that I posted.
 
sarah Marsh
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The statement you posted should be in the second.jsp file.

What should be in the first.jsp file for the text field? Thanks!
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You do not need anything in the first jsp file except the text field that the pop up window fills.

Eric
 
sarah Marsh
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much, I got it worked.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic