0
<form method="POST" action="prosesMultiple.php">
	<?php
	include 'connection.php';
	$sql="SELECT  defect_code,totalDaily FROM grandTotal ORDER BY totalDaily DESC LIMIT 10 ";
	$row = mysql_query ($sql);
   	while ($check=mysql_fetch_array($row)){?>
	
	   <input type="checkbox" name="defect_code[]" id="defect_code[]" value="<?php echo $check["defect_code"];?>" />
	   <?php echo $check["defect_code"];?> - <?php echo $check["totalDaily"]; ?> 
	   <input name="text"  name="totalDaily[]" id="totalDaily[]" type="hidden"  value="<?php echo $check["totalDaily"]; ?>"><br/>
   <?php } ?>
<p><input type="submit" value="Send" name="Send"></p>
</form>

the problem is i want pass the value of defect_code and totalDaily together at same time? after user select the checkboxes..is it practical i do like that

4
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by Jay-Kandari
0

On line 10, it should be input type="text".

and you can also echo at the same time.

echo $check["defect_code"] . " " . $check["totalDaily"]
0

On line 10, it should be input type="text".

and you can also echo at the same time.

echo $check["defect_code"] . " " . $check["totalDaily"]

ok..im done do it..but i want user select only 5 value..this my coding

<script type="text/javascript">
function chkcontrol(j) {
var total=0;
for(var i=0; i < document.form1.defect_code[].length; i++){
if(document.form1.defect_code[i].checked){
total =total +1;}
if(total > 5){
alert("Please Select only five") 
document.form1.defect_code[j].checked = false ;
return false;
}
}
} </script>
</head>
<body>

<?php print(Date("d-m-Y"));?>	
<form method="POST" action="prosesMultiple.php"  name="form1">
	<?php
	include 'connection.php';
	$sql="SELECT  defect_code,dpuDaily FROM grandTotal ORDER BY dpuDaily DESC LIMIT 10 ";
	$row = mysql_query ($sql);
   	while ($check=mysql_fetch_array($row)){?>
	
	   <input type="checkbox" name="defect_code[]" id="defect_code[]" value="<?php echo $check["defect_code"];?>" onclick="chkcontrol()"; />
	   <?php echo $check["defect_code"];?> - <?php echo $check["dpuDaily"]; ?> 
	   <input   name="dpuDaily[]" id="dpuDaily[]" type="hidden"  value="<?php echo $check["dpuDaily"]; ?>"/><input name="Date[]" type="hidden" id="Date[]" value="<?php echo Date("Y-m-d"); ?>" /><br/>
   <?php } ?>
<p><input type="submit" value="Send" name="Send"></p>
</form>

the script not runing..

0

There's a syntax error.. you cannot place a double quote (") inside an n existing quote. For Example in Line number 27.

<input   name="dpuDaily[]" id="dpuDaily[]" type="hidden"  value="<?php echo $check["dpuDaily"]; ?>"/><input name="Date[]" type="hidden" id="Date[]" value="<?php echo Date("Y-m-d"); ?>" /><br/>

<!-- This should be like this -->

<input   name="dpuDaily[]" id="dpuDaily[]" type="hidden"  value="<?php echo $check['dpuDaily']; ?>"/><input name="Date[]" type="hidden" id="Date[]" value="<?php echo Date('Y-m-d'); ?>" /><br/>

Please Correct all this type of Errors First.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.