disabled button still posts back?

B

Bob Schroeder

I want to conditionally disable/enable a link button based on what row
a user has selected in a grid.


I have some javascript that is called as a user selects different
rows in the grid.
I conditionally call this code in a javascript function

document.getElementById('btnChangeLot').disabled = true;

The button appears disabled (grayed out) as expected but it still
posts back...because .net's OnClick javascript:__DoPostBack
('btnChangeLot', '') attribute is still on the button? Is there anyway
to remove this attribute using javascript?

Is there other ways to get this to work?

Thanks!
 
J

John Saunders

Bob Schroeder said:
I want to conditionally disable/enable a link button based on what row
a user has selected in a grid.


I have some javascript that is called as a user selects different
rows in the grid.
I conditionally call this code in a javascript function

document.getElementById('btnChangeLot').disabled = true;

The button appears disabled (grayed out) as expected but it still
posts back...because .net's OnClick javascript:__DoPostBack
('btnChangeLot', '') attribute is still on the button? Is there anyway
to remove this attribute using javascript?

Is there other ways to get this to work?

Try document.getElementById('btnChangeLot').onclick = null;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top