File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Enabling button on row selection 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 "Enabling button on row selection" Watch "Enabling button on row selection" New topic

Enabling button on row selection

Sree Mami
Ranch Hand

Joined: Jul 13, 2006
Posts: 75
Hi all

This task needs to be achieved purely using HTML or Javascript

I have a form which consists of some form elements and table. I am getting values in the table from the database using jsp's. Whenever, I select a row those values needs to be displayed in the corresponding form elements which I am getting using:

onclick event of Table Row: passing the values in the row to a javascript function for setting row values in the corresponding form elements.

Along with all these I also have a button which is DISABLED by default, whenever I select a row that needs to be ENABLED

I tried this passing the other function to EnableButtons as 2nd argument to the onclick event of the Table Row, but it didn't work. What else can be done?

I tried pasting part of the code but I am getting some error, with the HTML < which I need to replace, so I am just explaining my problem here.
Vallidevi Appana

Joined: Jun 30, 2006
Posts: 25

I think you can use same method to populate the form elements and to enable button on onclick of table row.

put the following code in your js function...


here "myButton" is name of the button.
[ July 20, 2006: Message edited by: Vallidevi Appana ]
Sree Mami
Ranch Hand

Joined: Jul 13, 2006
Posts: 75
Hi Vallidevi Appanna

Ya, it's working that way.

Thank u
I agree. Here's the link:
subject: Enabling button on row selection
It's not a secret anymore!