473,396 Members | 1,921 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,396 software developers and data experts.

How do we check whether the checkbox is checked or not in php?

The part of my code where I am using the check box is given below:
In the html part:

Expand|Select|Wrap|Line Numbers
  1. <TD bgcolor="#FF0000"><Input type = "checkbox" Name = <?php "Save_" . $row["ID"] ?> Value = "YES" /></font></TD>
Since I need different names for check boxes according to the number of rows retrieved from the database,I am using rowid to identify the check box.

In the php part:

Expand|Select|Wrap|Line Numbers
  1. If (@$_POST["'Save_" . $row["ID"] . "'"] == "YES"){
  2. echo 'Starting Updation';
  3. }
Then I used the below code also........

Expand|Select|Wrap|Line Numbers
  1. If (@$_POST["Save_" . $row["ID"]] == "YES"){
  2. echo 'Starting Updation';
  3. }
Both of them are not working................
Plz help me to solve this problem...........
Thanks in advance
Feb 8 '11 #1
3 1721
Dormilich
8,658 Expert Mod 8TB
unchecked checkboxes are not passed to the server.
Feb 8 '11 #2
Hi Dormilich........
Thanks for your quick reply,but I didnt get the point.Here I checked the checkboxes which are required.
Feb 9 '11 #3
Dormilich
8,658 Expert Mod 8TB
you should remove the @ before $_POST and set full error display. PHP usually tells you if something is wrong.
Feb 9 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! How do I convert a CheckBox.Checked to an int? Regards Martin Arvidsson
6
by: AFN | last post by:
I want to click a checkbox and have a 4 line (approx) paragraph appear beneath the checkbox, pushing the rest of the page down. And when unchecking the checkbox, the paragraph should disappear...
2
by: Andrew | last post by:
Hi, I have a problem capturing the checkboxes that are checked, I get false irrespective of wether they are checked or not. I have gone thru the sample code on this forum, but they dun seem to...
3
by: Agnes | last post by:
I got 30 checkboxes in one Page, the user need to click at least one of it and then , the user can go to next step. Any simple method to check the checkboxes ? I don't want to use the following...
2
by: limbo2u | last post by:
I'm using the following code for a checkbox that when clicked, either checks or unchecks a group of checkboxes on a form. The code works fine, except when there is only one checkbox in the group in...
0
by: Jayender | last post by:
I need to know how to get the selected checkbox from the gridview ? so i can update that to the database... see i need to check whether the checkbox is cheked or not in my button funtion. ...
10
by: rn5a | last post by:
All the rows in a DataGrid, including the Header, are accompanied with a CheckBox. I want that when the CheckBox in the Header is checked, then all the CheckBoxes should automatically get checked....
3
by: cvijaykrishna | last post by:
i have a web based website in which i have some 14 tabs(i took labels) i placed all 14 tabs controls in 14 different views of a multiview and in the click event of each label i am writing ...
2
by: Boki | last post by:
Hi All, About the webbrowser, I can do the auto fill in text now. Now, I have another problem, I can't do auto check a checkbox. Whatever what value I set to the checkbox, it is still showing...
3
by: nologo | last post by:
All, Have a problem i just cant find the answer for. I'm trying to populate a colum in a SQL database. Basically the column requires a 1 or 0. I'm trying to populate this col via a c#...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
0
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...
0
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,...
0
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...

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.