disabled button still posts back?

  • Thread starter Thread starter Bob Schroeder
  • Start date Start date
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!
 
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

Back
Top