Forum Moderators: open

Message Too Old, No Replies

Enable/Disable buttons dynamically

Enable/Disable buttons dynamically

         

goodboy553

1:51 pm on Apr 22, 2004 (gmt 0)



hello,

i have a web page contains 10 to 12 buttons. some are enabled and some are disabled. Clicking on one button may enable or disable other button.
for one transaction, i.e., when clicked on one button enabling or disabling other button, i can write a method. but in a particular situation, there will be 20 to 30 transactions on one page. I can't write 30 methods for that na.
So I came out with an idea to write two functions in js - enable(String buttonName) and disable(String buttonName) with the body as document.formName.buttonName.disabled = true; and document.formName.buttonName.disabled = false; respectively.
It doesn't seem to be working. please help me out in writing my method.
Thanking you,
Lakshman Pilaka.

Bernard Marx

3:34 pm on Apr 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What does the function actually look like (one or both of them)?