473,387 Members | 1,541 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.

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 6581
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**********@inds.com> wrote in message
news:uE**************@tk2msftngp13.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**************@TK2MSFTNGP12.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**********@inds.com> wrote in message
news:uE**************@tk2msftngp13.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**********@inds.com> wrote in message
news:eS**************@TK2MSFTNGP12.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**************@TK2MSFTNGP12.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**********@inds.com> wrote in message
news:uE**************@tk2msftngp13.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**************@TK2MSFTNGP12.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**********@inds.com> wrote in message
news:eS**************@TK2MSFTNGP12.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**************@TK2MSFTNGP12.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**********@inds.com> wrote in message
news:uE**************@tk2msftngp13.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.com> wrote in message
news:us**************@TK2MSFTNGP10.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**************@TK2MSFTNGP12.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**********@inds.com> wrote in message
news:eS**************@TK2MSFTNGP12.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**************@TK2MSFTNGP12.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**********@inds.com> wrote in message
> news:uE**************@tk2msftngp13.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**************@TK2MSFTNGP10.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.com> wrote in message
news:us**************@TK2MSFTNGP10.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**************@TK2MSFTNGP12.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**********@inds.com> wrote in message
news:eS**************@TK2MSFTNGP12.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**************@TK2MSFTNGP12.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**********@inds.com> wrote in message
> > news:uE**************@tk2msftngp13.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**********@inds.com> wrote in message
news:uE**************@tk2msftngp13.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
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...
3
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...
1
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...
8
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...
4
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...
2
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 ...
3
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...
1
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...
1
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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.