GeeCON Prague 2014*
The moose likes HTML, CSS and JavaScript and the fly likes How to copy a value to the same page? 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 "How to copy a value to the same page?" Watch "How to copy a value to the same page?" New topic
Author

How to copy a value to the same page?

sumanth kumar
Greenhorn

Joined: Jul 29, 2005
Posts: 22
Here is a scenario, the page displays a table of values comes from database(ID, First Name, Last Name, Telephone), here ID column displays with links and if we click on the link the corresponding ID value should goes to a textbox on the same page. I know the javascript can do this but I've no idea how to make, could someone help me on this?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

Establish a click handler for the link, within which you can fetch the id value and stuff it into the appropriate target.

How is the id value associated with the link?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Blaidd Gwael
Greenhorn

Joined: Oct 01, 2009
Posts: 13



or if you want an input and not a textarea:



sumanth kumar
Greenhorn

Joined: Jul 29, 2005
Posts: 22
Thanks Blaidd and Bear for replying.. Blaidd given solution would perfectly gave me the solution.

I got another question on the same thing that if the page displays 100s of rows and when we click on the link the id goes to textarea but the location is not moving to the textarea in the same page where we clicked, I need to move location to textarea. In order to do this the same there must be a javascript clue, can you please give me the solution.

Thanks, I really appreciate..
Blaidd Gwael
Greenhorn

Joined: Oct 01, 2009
Posts: 13



should work...
sumanth kumar
Greenhorn

Joined: Jul 29, 2005
Posts: 22
Excellent ..Blaidd Gwael.. works. Thanks
 
GeeCON Prague 2014
 
subject: How to copy a value to the same page?