473,387 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

disabled button still posts back?

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!
Nov 18 '05 #1
1 1413
"Bob Schroeder" <bo**********@hotmail.com> wrote in message
news:5e**************************@posting.google.c om...
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;
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Nick Li | last post by:
Hi, I need to create a html page so that "Back" button(or some other button) is disabled in IE browser. I would appreciate your help. Nick Li
6
by: JSjones | last post by:
Hi all, I'm new to these boards and my javascript experience is fairly limited and basic so please bear with me. Anyway, on to the question and some background. I'm developing using ColdFusion...
1
by: chad.arimura | last post by:
I've got a form inside a PHP script that posts to itself, does some processing on the PHP side, and if it looks good, PHP sends a HEADER command that redirects the user out. All was fine until I...
2
by: David Stahl | last post by:
Good evening. I was hoping someone can help me: I have an ASP.NET page which contains an ArrayList bound to a DataGrid. The DataGrid displays, in columns, a few members of the objects in this...
1
by: Bob Schroeder | last post by:
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...
6
by: Mark | last post by:
I have two dropdown lists. Both have autopostback set to true. In both dropdowns, when you select an item from the list, it redirects to the Value property of the dropdown. Nothing fancy. ...
3
by: Bubba Gump | last post by:
I hope someone can help here. I'm creating a form that disables certain fields depending on the users choices. But I've noticed that Disabled fields aren't "grayed out" (ie: you can't tell they're...
26
by: Jeremy | last post by:
Hi, say we have the code below on a button: <input type="button" class="btn" value="Continue" onclick="if (myform.p_name.value=='') alert('You must enter a name for the folder'); else {...
17
by: govolsbaby | last post by:
Is there a way to leave the button forecolor unchanged when it is disabled? I have multiple buttons on the form and depending on various user inputs, some will or will not be enabled but I'd...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.