This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Enabling button on row selection

 
Sree Mami
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

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...

document.getElementById("myButton").disabled=false;

here "myButton" is name of the button.
[ July 20, 2006: Message edited by: Vallidevi Appana ]
 
Sree Mami
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vallidevi Appanna

Ya, it's working that way.

Thank u
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic