curiouswebster
asked on
I need to enable and disable a button using JavaScript, ASP and ASP.NET
I have a simple request that I would like to create a test program which uses JavaScript to disable (then re-enable) an ASP button. I would also like to see how the same thing's done with ASP.NET.
Maybe someone could post a simple program with two buttons where when you click one, it enables the other and disables the button you clicked. I would love to see that in ASP as well as ASP.NET.
I would be happy to write it, but I think it may be easier for someone to write than explain.
Thanks,
newbieweb
Maybe someone could post a simple program with two buttons where when you click one, it enables the other and disables the button you clicked. I would love to see that in ASP as well as ASP.NET.
I would be happy to write it, but I think it may be easier for someone to write than explain.
Thanks,
newbieweb
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Tomarse111,
I used your code sinnce it was all in one place. Could you do the same thing with ASP.NET? I'm trying to learn both technologies at the same time...
newbieweb
I used your code sinnce it was all in one place. Could you do the same thing with ASP.NET? I'm trying to learn both technologies at the same time...
newbieweb
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Where would you put that line? LLike this?
document.getElementById('b ttn2').Ena ble = false;
what about the controls? How are they different?
document.getElementById('b
what about the controls? How are they different?
If you are referring to ASP.NET then it would go in your code behind.
This change would occur on the server and not on the client directly.
This change would occur on the server and not on the client directly.
ASKER
I see. Code behind makes it easy for me to do: I'm a WinForms C# developer. But I need to learn the HTML side of ASP.NET.
Thanks,
newbieweb
Thanks,
newbieweb
Then the JavaScript methods above are the ebst way. Unless you want to do it all server side with a postback!
Here is the JavaScript version:
Open in new window