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

get Mutiple check box value

hi,

i using mutiple check box but i didn't get all value...


Expand|Select|Wrap|Line Numbers
  1. as
  2.  
  3. $res=mysql_query("select * from cie where des='Resource Pipeline Associate' order by name");
  4. $j=0;
  5.         $norow=mysql_num_rows($res);
  6.         $flag=false;
  7.     while($td=mysql_fetch_array($res))
  8.     {
  9.                 for($i=0;$i<count($can);$i++)
  10.  
  11.             {    
  12.                     if("$td[1]"=="$can[$i]")
  13.                     {
  14.                         $flag=true;
  15.                         $i=count($can);
  16.                     }
  17.                     else
  18.                     {
  19.                     $flag=false;
  20.                     }
  21.             }
  22.                 if($flag==true)
  23.                 {
  24. print"        <tr><td><input type=\"checkbox\" name=\"selcie\" id=\"selcie\" value=\"$td[1]\" checked>$td[1]</td></tr>";
  25.                 }
  26.                 else
  27.                 {
  28. print"        <tr><td><input type=\"checkbox\" name=\"selcie\" id=\"selcie\" value=\"$td[1]\" >$td[1]</td></tr>";                
  29.                 }
  30.                 $j++;
  31.     }             
  32.  
  33. $cie=$_SESSION["user"];
  34. $da=$_POST['selcie'];
  35. $reqid=$_SESSION['insertid'];
  36. $res=mysql_query("insert into allocate (name,reqid) values('$da','$reqid')");
  37.  
i have problem to get mutiple value instead of i get last value from check box only....
Feb 26 '08 #1
7 1692
hsriat
1,654 Expert 1GB
Instead of name=\"selcie\", use name=\"selcie[ ]\" (line # 24, 28)

The value will be received as $_POST['selcie'][0] and so on...
Feb 26 '08 #2
Instead of name=\"selcie\", use name=\"selcie[ ]\" (line # 24, 28)

The value will be received as $_POST['selcie'][0] and so on...

if i give selcie[] means i have validation problem in java script.....
Feb 26 '08 #3
hsriat
1,654 Expert 1GB
if i give selcie[] means i have validation problem in java script.....
Ok, for JavaScript, as I already showed that example (In JavaScript Forum),
use id along with name, like...

[html]<select name="selcie[]" id="selice">[/html]

and in JavaScript, instead of document.formName.selcie
use document.getElementById('selice')
Feb 26 '08 #4
Markus
6,050 Expert 4TB
Use class="selcie"

If you dont. the guys in html will throw a fit.

id = unique id
when used twice it isnt unique ;)
Feb 26 '08 #5
Ok, for JavaScript, as I already showed that example (In JavaScript Forum),
use id along with name, like...

[html]<select name="selcie[]" id="selice">[/html]

and in JavaScript, instead of document.formName.selcie
use document.getElementById('selice')

it will work in first check box only.....
Feb 26 '08 #6
Markus
6,050 Expert 4TB
it will work in first check box only.....
Because id's are for unique elements.
Feb 26 '08 #7
hsriat
1,654 Expert 1GB
Because id's are for unique elements.
OOPS!..
I thought it was select, but it was checkbox.

@shanmugamit
look at your same question in the JavaScript forum
Feb 26 '08 #8

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

Similar topics

0
by: deepak | last post by:
i have set multiple selection property in bith listboxes(html control) to true. i have taken 2 buttons(html control) say Button1,Button2.now i want to add mutiple selected items to another listbox...
0
by: saravana | last post by:
I have to display the mutiple xml filename path in treeview control using c#. net some thing like this In treeview control....... ========= =C:\\a.xml=
2
by: underground | last post by:
I need a little help figuring this one out. I have a script that should post mutiple binary files into a single row but instead of copying the indiviuals files it rewrites the first file to all the...
10
by: underground | last post by:
I need a little help figuring this one out. I have a script that I've modified to post mutiple binary files into a single row but instead of copying the indiviuals files it rewrites the first file to...
3
by: shanmugamit | last post by:
hi, i am new to this forum.i need help for view a mutiple selected value from database.....that is already selected value display.. my code..... $jobcount=count($vinloc); print" <td><select...
6
by: shanmugamit | last post by:
hi, var len=document.form.check.length flag=false; for(i=0;i<len;i++) { if(document.form.check.checked==true) { flag=true; break;
2
by: ravitunk | last post by:
hi..i have a datagridview in my windows application using C#......i want to select mutiple cells(by pressing shift key) or select mutiple columns or multiple rows.....if this happens then i should...
6
by: dewraj | last post by:
Hi I am using windows applicaiton(.net) as front end, and I want to get mutiple tables in Dataset by executing a single stored procedure i.e. SP would return mutiple tables (record sets) with the...
1
by: chennaibala | last post by:
can any one send me mutiple image upload program and save the file name with extension in mysql table.we must cheak uploaded file type like bmp or any image file while uploading. i develop...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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: 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
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.