473,804 Members | 3,182 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Disable checkbox

I have a checkbox that I set by php code to be either "checked" or "".
I want to disable the ability of the user to check or uncheck it. I
tried "readonly", but that didn't work. Any suggestions?

Feb 16 '06 #1
7 12577

sheldo...@gmail .com wrote:
I have a checkbox that I set by php code to be either "checked" or "".
I want to disable the ability of the user to check or uncheck it. I
tried "readonly", but that didn't work. Any suggestions?


<http://www.google.com/search?q=disabl e+checkbox>

Try the first link that comes up.

Feb 16 '06 #2
I think it is disabled="true" that you want to use. That should work, I
think.

Feb 16 '06 #3

Michael wrote:
I think it is disabled="true" that you want to use. That should work, I
think.


HTML style:
<input type="checkbox" name="foo" disabled>

XHTML style:
<input type="checkbox" name="foo" disabled="disab led"/>

Feb 16 '06 #4

"ZeldorBlat " <ze********@gma il.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .

Michael wrote:
I think it is disabled="true" that you want to use. That should work, I
think.


HTML style:
<input type="checkbox" name="foo" disabled>

XHTML style:
<input type="checkbox" name="foo" disabled="disab led"/>


The "disabled" worked. What is that trailing slash for?
Feb 17 '06 #5

Shelly wrote:
"ZeldorBlat " <ze********@gma il.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
HTML style:
<input type="checkbox" name="foo" disabled>

XHTML style:
<input type="checkbox" name="foo" disabled="disab led"/>


The "disabled" worked. What is that trailing slash for?


XHTML compliance. In XHTML, all tags must have matching closing tags.
Some tags are "self-closing" however (like <input>) so instead of a
</input> you just leave a trailing / to close it.

Feb 17 '06 #6
ZeldorBlat schrieb:
Michael wrote:
I think it is disabled="true" that you want to use. That should work, I
think.

HTML style:
<input type="checkbox" name="foo" disabled>

XHTML style:
<input type="checkbox" name="foo" disabled="disab led"/>


Disabled and readonly are different things - IIRC the values of readonly
elements are submitted while the values of disabled elements are not. So
the OP could run into problems in the case of:

<input type="checkbox" name="foo" value="1" checked disabled>

In this case readonly is definitely the correct attribute. Internet
Explorer seems not to support readonly, though, which is a bug.

Anyway as this is not a PHP topic there might more detailed information
to be found in an HTML group.

--
Markus
Feb 17 '06 #7
In my case it is "disabled". The reason is that I want to show which
uploads have been done as indicated by the presence of the file on the
server. I dynamically put in "disabled" or leave it blank. If it is
disabled, I set it as checked. I do this by checking for the presence
of the files on the server and setting session variables if they are
there. In other words, the check box is not a "choice". Rather, it is
an indicator of completion.

When the user does the submit for the entire transaction, I first check
to see if all the required uploads are present (not all are required),
and then process the information. (All that is done is PHP). If they
are not all there, I present the user with information about the what
is missing.

When he uploads the missing file, the checkbox is set as checked and
disabled.

Shelly

Feb 17 '06 #8

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

Similar topics

1
1597
by: Vikram | last post by:
How to disble a particular checkbox list item in a checkbox list
4
10435
by: Matrixreloadedth | last post by:
How to change disable color of Checkbox??? I have a checkbox with forecolor in red but when i disable by set Enable properties to false forecolor is changed to gray color but i don't want it. how to make disable color as the same before set enable = false Anyone can help me?????
3
18206
by: James Lennon | last post by:
Does anyone know how to disable a single check box in a Windows Forms TreeView control.
0
1539
by: Li Pang | last post by:
Hi, I want to know how to disable some of checkbox in a listview programatically. thanks
2
2126
by: madhusudanreddy | last post by:
hi iam new to scripts, i have a dropdownlist and ckeckbox ,i want to disable the ckeckbox when the user selects the second option of dropdownlist .how to do this please help me..........?
6
1931
by: feninazman | last post by:
hi ;) i'm doing my intern now.this is my 1st time using ASP.NET web matrix with VB.NET language... i need help in disabling my checkboxes. i have 4 checkboxes, let say "air" "water" "ice" "snow" if i check "air", i want all other 3 checkboxes to be disabled. it's something like a objective answer sheet but i'm asked to do it with checkbox not option button.. help me please...thanx loads...
1
2980
by: rash007 | last post by:
I am building up a table in php built from an array in a database. I can assign each row its own id's etc. But I need to enable or disable checkbox buttons and a text area depending on the checkbox for that row being checked or not. hotellist.php <div align="center"><input type="checkbox" name="en1" id="en1" onclick="enable1(this.checked)"> <input type="hidden" name="editid" id="editid" value="<?php echo $id ?>" /></div> hotel.php ...
2
5026
by: tvnaidu | last post by:
How can I disable checkbox when it is selected Kernel?. <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td align="right" width="40%" valign="top" class="text1">Facility:</td> <td width="60%" valign="top" class="text1"> <select name="logConfig.facility" size="1" class="txtbox" id="selFacility"> <option $| web.dropdownSelected(configRow == "Kernel") |$ value="Kernel">Kernel</option> <option $|...
5
2603
by: gina farrow | last post by:
I have form that needs to be checked by four people. I need to show the check marks on the form and once they have checked the box they cant change it.
0
9708
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
9587
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
10588
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
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
9161
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...
1
7623
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4302
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
3
2998
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.