469,645 Members | 1,757 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

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 6350
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Eric Linders | last post: by
8 posts views Thread by EdB | last post: by
2 posts views Thread by =?Utf-8?B?VG9ueSBBLg==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.