473,662 Members | 2,752 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Check checkbox, prevent user from unchecking

Hello.

I need to set a checkbox to the "checked" state and prevent the user from
unchecking it. I tried using "disabled", but then the value is not passed on
the Post to an ASP page.

Anyone have any ideas?

Thanks in advance,

Mike
Jul 19 '05 #1
7 6611
If the user cannot uncheck it, why does it exist? You can use disabled, but
then use a hidden input to carry through the value if you have to carry it
through. Depending on what you're doing, you may not have to carry it
through, because if your code knows that it should write the checkbox
disabled, you can make that same determination on the page that to which the
form posts.

Ray at work

"Mike Lopez" <Mi**********@i nds.com> wrote in message
news:uE******** ******@tk2msftn gp13.phx.gbl...
Hello.

I need to set a checkbox to the "checked" state and prevent the user from
unchecking it. I tried using "disabled", but then the value is not passed on the Post to an ASP page.

Anyone have any ideas?

Thanks in advance,

Mike

Jul 19 '05 #2
Hi, Ray. Thanks for responding.

The checkbox(es) reflect surcharges that may or may not be automatically
checked, based on criteria. The user needs to know that a surcharge applies.
That's why it exists.

I was trying to avoid a hidden field because there are other checkboxes in
the same checkbox group that are not automatically checked. Maintaining the
value of the hidden field is a pain.

Making the same determination can be costly. I do it once, up front.

Any other thoughts?

"Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in message
news:O7******** ******@TK2MSFTN GP12.phx.gbl...
If the user cannot uncheck it, why does it exist? You can use disabled, but then use a hidden input to carry through the value if you have to carry it
through. Depending on what you're doing, you may not have to carry it
through, because if your code knows that it should write the checkbox
disabled, you can make that same determination on the page that to which the form posts.

Ray at work

"Mike Lopez" <Mi**********@i nds.com> wrote in message
news:uE******** ******@tk2msftn gp13.phx.gbl...
Hello.

I need to set a checkbox to the "checked" state and prevent the user from unchecking it. I tried using "disabled", but then the value is not
passed on
the Post to an ASP page.

Anyone have any ideas?

Thanks in advance,

Mike


Jul 19 '05 #3
I see. I still suggest using hidden fields then, I'd say. If you name the
hidden field the same name as your checkboxes, it won't matter that it's not
a checkbox. Also, IIRC, the enabled=false (or is it disabled=true) isn't
totally cross-browser compatible. So, perhaps you'll want to display the
uncheckable items in a different way, like just in a bulleted list or
something.

Ray at work

"Mike Lopez" <Mi**********@i nds.com> wrote in message
news:eS******** ******@TK2MSFTN GP12.phx.gbl...
Hi, Ray. Thanks for responding.

The checkbox(es) reflect surcharges that may or may not be automatically
checked, based on criteria. The user needs to know that a surcharge applies. That's why it exists.

I was trying to avoid a hidden field because there are other checkboxes in
the same checkbox group that are not automatically checked. Maintaining the value of the hidden field is a pain.

Making the same determination can be costly. I do it once, up front.

Any other thoughts?

"Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in message
news:O7******** ******@TK2MSFTN GP12.phx.gbl...
If the user cannot uncheck it, why does it exist? You can use disabled,

but
then use a hidden input to carry through the value if you have to carry it
through. Depending on what you're doing, you may not have to carry it
through, because if your code knows that it should write the checkbox
disabled, you can make that same determination on the page that to which

the
form posts.

Ray at work

"Mike Lopez" <Mi**********@i nds.com> wrote in message
news:uE******** ******@tk2msftn gp13.phx.gbl...
Hello.

I need to set a checkbox to the "checked" state and prevent the user

from unchecking it. I tried using "disabled", but then the value is not

passed
on
the Post to an ASP page.

Anyone have any ideas?

Thanks in advance,

Mike



Jul 19 '05 #4
if you want to maintain a consistent view, maybe a gif of a checked box
rather than a check box?

regards
paul

"Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in message
news:u8******** ******@TK2MSFTN GP12.phx.gbl...
I see. I still suggest using hidden fields then, I'd say. If you name the hidden field the same name as your checkboxes, it won't matter that it's not a checkbox. Also, IIRC, the enabled=false (or is it disabled=true) isn't
totally cross-browser compatible. So, perhaps you'll want to display the
uncheckable items in a different way, like just in a bulleted list or
something.

Ray at work

"Mike Lopez" <Mi**********@i nds.com> wrote in message
news:eS******** ******@TK2MSFTN GP12.phx.gbl...
Hi, Ray. Thanks for responding.

The checkbox(es) reflect surcharges that may or may not be automatically
checked, based on criteria. The user needs to know that a surcharge applies.
That's why it exists.

I was trying to avoid a hidden field because there are other checkboxes in
the same checkbox group that are not automatically checked. Maintaining

the
value of the hidden field is a pain.

Making the same determination can be costly. I do it once, up front.

Any other thoughts?

"Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in message
news:O7******** ******@TK2MSFTN GP12.phx.gbl...
If the user cannot uncheck it, why does it exist? You can use
disabled, but
then use a hidden input to carry through the value if you have to
carry it through. Depending on what you're doing, you may not have to carry it
through, because if your code knows that it should write the checkbox
disabled, you can make that same determination on the page that to

which the
form posts.

Ray at work

"Mike Lopez" <Mi**********@i nds.com> wrote in message
news:uE******** ******@tk2msftn gp13.phx.gbl...
> Hello.
>
> I need to set a checkbox to the "checked" state and prevent the user

from
> unchecking it. I tried using "disabled", but then the value is not

passed
on
> the Post to an ASP page.
>
> Anyone have any ideas?
>
> Thanks in advance,
>
> Mike
>
>



Jul 19 '05 #5
I was thinking that also, but checkboxes look different in different
browsers and they also look different in IE if the person is running XP with
the Candyland theme.

Ray at work

"Paul" <pa**@nospam.co m> wrote in message
news:us******** ******@TK2MSFTN GP10.phx.gbl...
if you want to maintain a consistent view, maybe a gif of a checked box
rather than a check box?

regards
paul

"Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in message
news:u8******** ******@TK2MSFTN GP12.phx.gbl...
I see. I still suggest using hidden fields then, I'd say. If you name the
hidden field the same name as your checkboxes, it won't matter that it's

not
a checkbox. Also, IIRC, the enabled=false (or is it disabled=true) isn't
totally cross-browser compatible. So, perhaps you'll want to display the uncheckable items in a different way, like just in a bulleted list or
something.

Ray at work

"Mike Lopez" <Mi**********@i nds.com> wrote in message
news:eS******** ******@TK2MSFTN GP12.phx.gbl...
Hi, Ray. Thanks for responding.

The checkbox(es) reflect surcharges that may or may not be automatically checked, based on criteria. The user needs to know that a surcharge

applies.
That's why it exists.

I was trying to avoid a hidden field because there are other checkboxes in the same checkbox group that are not automatically checked.
Maintaining
the
value of the hidden field is a pain.

Making the same determination can be costly. I do it once, up front.

Any other thoughts?

"Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in

message news:O7******** ******@TK2MSFTN GP12.phx.gbl...
> If the user cannot uncheck it, why does it exist? You can use

disabled, but
> then use a hidden input to carry through the value if you have to carry
it
> through. Depending on what you're doing, you may not have to carry it > through, because if your code knows that it should write the checkbox > disabled, you can make that same determination on the page that to

which the
> form posts.
>
> Ray at work
>
> "Mike Lopez" <Mi**********@i nds.com> wrote in message
> news:uE******** ******@tk2msftn gp13.phx.gbl...
> > Hello.
> >
> > I need to set a checkbox to the "checked" state and prevent the user from
> > unchecking it. I tried using "disabled", but then the value is not
passed
> on
> > the Post to an ASP page.
> >
> > Anyone have any ideas?
> >
> > Thanks in advance,
> >
> > Mike
> >
> >
>
>



Jul 19 '05 #6
ah. good point. I need to get out of the "I own the intranet and it's IE
only" frame of mind.

damn these dependencies

regards
paul

"Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in message
news:Oq******** ******@TK2MSFTN GP10.phx.gbl...
I was thinking that also, but checkboxes look different in different
browsers and they also look different in IE if the person is running XP with the Candyland theme.

Ray at work

"Paul" <pa**@nospam.co m> wrote in message
news:us******** ******@TK2MSFTN GP10.phx.gbl...
if you want to maintain a consistent view, maybe a gif of a checked box
rather than a check box?

regards
paul

"Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in message
news:u8******** ******@TK2MSFTN GP12.phx.gbl...
I see. I still suggest using hidden fields then, I'd say. If you name
the
hidden field the same name as your checkboxes, it won't matter that
it's
not
a checkbox. Also, IIRC, the enabled=false (or is it disabled=true)
isn't totally cross-browser compatible. So, perhaps you'll want to display the uncheckable items in a different way, like just in a bulleted list or
something.

Ray at work

"Mike Lopez" <Mi**********@i nds.com> wrote in message
news:eS******** ******@TK2MSFTN GP12.phx.gbl...
> Hi, Ray. Thanks for responding.
>
> The checkbox(es) reflect surcharges that may or may not be automatically > checked, based on criteria. The user needs to know that a surcharge
applies.
> That's why it exists.
>
> I was trying to avoid a hidden field because there are other checkboxes
in
> the same checkbox group that are not automatically checked.

Maintaining the
> value of the hidden field is a pain.
>
> Making the same determination can be costly. I do it once, up front.
>
> Any other thoughts?
>
> "Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in message > news:O7******** ******@TK2MSFTN GP12.phx.gbl...
> > If the user cannot uncheck it, why does it exist? You can use

disabled,
> but
> > then use a hidden input to carry through the value if you have to

carry
it
> > through. Depending on what you're doing, you may not have to
carry it > > through, because if your code knows that it should write the checkbox > > disabled, you can make that same determination on the page that to

which
> the
> > form posts.
> >
> > Ray at work
> >
> > "Mike Lopez" <Mi**********@i nds.com> wrote in message
> > news:uE******** ******@tk2msftn gp13.phx.gbl...
> > > Hello.
> > >
> > > I need to set a checkbox to the "checked" state and prevent the user > from
> > > unchecking it. I tried using "disabled", but then the value is

not > passed
> > on
> > > the Post to an ASP page.
> > >
> > > Anyone have any ideas?
> > >
> > > Thanks in advance,
> > >
> > > Mike
> > >
> > >
> >
> >
>
>



Jul 19 '05 #7

Ray Wrote:

"If the user cannot uncheck it, why does it exist?"

I asked the same question but then I thought about what
Ford does when you customize a vehicle on there Web-site.
They will disable a checkbox to keep you from selecting an
option that does go with the package you just chose.

-----Original Message-----
If the user cannot uncheck it, why does it exist? You can use disabled, butthen use a hidden input to carry through the value if you have to carry itthrough. Depending on what you're doing, you may not have to carry itthrough, because if your code knows that it should write the checkboxdisabled, you can make that same determination on the page that to which theform posts.

Ray at work

"Mike Lopez" <Mi**********@i nds.com> wrote in message
news:uE******* *******@tk2msft ngp13.phx.gbl.. .
Hello.

I need to set a checkbox to the "checked" state and prevent the user from unchecking it. I tried using "disabled", but then the
value is not passedon
the Post to an ASP page.

Anyone have any ideas?

Thanks in advance,

Mike

.

Jul 19 '05 #8

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

Similar topics

2
8428
by: Eric Linders | last post by:
Hi, In my form, I have a checkbox that must be checked in order to process the form. By default, I want it to be checked when the page first appears. I can do that easily enough by hardcoding the "checked" property. My problem occurs when I try to validate it. If the visitor unchecks the checkbox, the form cannot be processed,
3
2334
by: Jack | last post by:
Hi, I have a form when loaded, retrieves record from an access table. Among other fields there is a check box called FinalUpdate. This is tied to a field in Access of type Yes/No. The form retieves the values perfectly. This form is being used to update the record in the table via a successconfirmation.asp. Now, when the checkbox is loaded as checked, then unchecking the checkbox reflects the change in query result in...
1
4229
by: sianan | last post by:
I tried to use the following example, to add a checkbox column to a DataGrid in an ASP.NET application: http://www.codeproject.com/aspnet/datagridcheckbox.asp For some reason, I simply CAN'T get the example to work. I created the following two classes, provided with the example: *-*-**-*-*-*-*-*-*-*-*-*-**-*-*-*-*-CheckBoxColumn Class:-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-**-*-*-*
8
4674
by: EdB | last post by:
In VB6, you could set a check box to checked, unchecked, or greyed. The latter would be used to show a setting but disable the control. In .Net, the third choice is not greyed, but indeterminate. And the doc says it shows it as greyed, but checked. So how do you show greyed and unchecked? Disabling the control in total greys out the control's text which is less than desirable.
4
11682
by: chengsi | last post by:
Hi, I have a "continuous" subform which is linked to a table which has a checkbox field. I would like to create a Check All/Uncheck All checkbox control that both checks and disables the checkboxes in the subform. At the moment I can disable/enable all textboxes, however my coding only checks/unchecks the FIRST checkbox in the subform, and ignores the other checkboxes in the list. My current VBA code is: Private Sub...
2
2765
by: =?Utf-8?B?VG9ueSBBLg==?= | last post by:
I have a datagridview on a Windows form where one of the columns is a checkbox. After checking or unchecking the checkbox I try to update the database. The following error appears System.InvalidOperationException was unhandled Edits to Textbox columns update without a problem. Any suggestion on what I'm doing wrong. Thanks... --
3
2825
by: Ryanfromscotland | last post by:
Hey there everyone, this is my first post so be nice :-) I have wrote quite a bit so the actual question is written out at the end if you want to skip on and see if you can answer it without the rest of the info. I'm a hobbiest programmer and have taken up the project of writing a savestate editor - if you don't know what that is it's not really important - but I am having a bit of trouble with some code and google isn't turning up the answer...
1
4509
Frinavale
by: Frinavale | last post by:
I'm working on an ASP.NET application using VB.NET for server side code. I have a GridView listing a bunch of stuff. Above the GridView I have a checkbox named "ChkBx_SelectAll". If this checkbox is checked, all of the rows in the GridView are checked, if this checkbox is unchecked, all of the rows in the GridView are unchecked. This checking/unchecking of the checkboxes in the GridView is handled by a JavaScript method: function...
1
1849
Death Slaught
by: Death Slaught | last post by:
I play a game that when your backpack fills with items (the limit is 45) you must choose items to discard by unchecking their box. This is very annoying and time consuming so I was wondering if it were possible to create a Javascript function to be saved as a bookmark, and when used it prompts for the checkbox to start at (so it won't discard items that I want to keep) and discards all items after that point. So my main question is, is it...
0
8435
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8768
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7368
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4181
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.