473,396 Members | 1,743 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 to make the check box to checked

65
Hello,

let say i have two array and i need to compare the value inside the array and after that if same value then show the check box is checked and the no same value will show the check box only..

Expand|Select|Wrap|Line Numbers
  1. foreach($idarray as $id){
  2.  
  3.   foreach($selidarray as $selid){
  4.     if ($id==$selid){
  5.      //show the check box with checked
  6.     }else{
  7.     //show the check box only
  8.     }
  9.   }
  10.  
  11. }
[Please use CODE tags when posting source code. Thanks! --pbmods]

but this code is not i want..

can someone help me?
Jul 10 '07 #1
1 1822
pbmods
5,821 Expert 4TB
Heya, wish.

Let say i have two array and i need to compare the value inside the array and after that if same value then show the check box is checked and the no same value will show the check box only..

Expand|Select|Wrap|Line Numbers
  1. foreach($idarray as $id){
  2.  
  3.   foreach($selidarray as $selid){
  4.     if ($id==$selid){
  5.      //show the check box with checked
  6.     }else{
  7.     //show the check box only
  8.     }
  9.   }
  10.  
  11. }
That code looks about right, except that you'll probably want to put some output where the comments are.
Jul 10 '07 #2

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

Similar topics

1
by: vncntj | last post by:
i want to enable one listbox and disable the other depending on if i check winter_gala (checkbox) here is my code. <script type="text/javascript"> function check() { if...
1
by: Jim in Arizona | last post by:
I'm having dificulty figuring out how to process multiple check boxes on a web form. Let's say I have three check boxes: cbox1 cbox2 cbox3 The only way I can think of to code the...
6
by: jonefer | last post by:
It seems that the following code should work - (if not why is the event there?) (Do I need some sort of client side script to awaken it?) Private Sub chkRefresh_CheckedChanged(ByVal sender As...
2
by: bschaeffer | last post by:
Thanks to these forums I have learned how to make a list of check boxes visible/not visible based on the value of another check box. However, the purpose of this is to save room on the form. ...
16
by: Brian Tkatch | last post by:
Is there a way to check the order in which SET INTEGRITY needs to be applied? This would be for a script with a dynamic list of TABLEs. B.
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....
5
by: starke1120 | last post by:
Im creating a check in – check out database for RF guns. I have a table that contains models. ID (primary key) Model A table that contains Gun Details ID (primary key) Model_id...
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
by: ghjk | last post by:
my php page has 7 check boxes. I stored checked values to database and retrive as binary values. This is the result array Array ( => 0 => 1 => 0 => 1 => 0 => 0 => 1 ) 1 means checked....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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...
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,...

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.