Jump to content

checkbox help....


ccrevcypsys

Recommended Posts

well i need to get it to work with php and i dont know how... here is my php code (and im using a different java method)

 

<?php
while ($row_region = @mysql_fetch_array($result_region, MYSQL_ASSOC)){
	$sel = "";

	if ($row[asia_pacific] == $row_region[keyid] || $row[EMEA] == $row_region[keyid] || $row[greater_china] == $row_region[keyid] || $row[latin_america] == $row_region[keyid] || $row[north_america] == $row_region[keyid] || $row[region] == $row_region[keyid]) {

		$sel = " checked";

	}elseif(isset($_POST[''.$row_region[keyid].''])){

		$sel = " checked";

	}

	$region_opt .= "<input name='list' type='checkbox' value='$row_region[keyid]'$sel />$row_region[region_name]";
}
$field_list = "
		<div style='margin-left: 100px'><input style='display:none;' type='text' name='region' rows='1' cols='35' value='0' /><em>All not yet working...</em><br><SCRIPT LANGUAGE='JavaScript'>
<!-- Begin
var checkflag = 'false';
function check(field) {
if (checkflag == 'false') {
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
checkflag = 'true';
return 'Uncheck All'; }
else {
for (i = 0; i < field.length; i++) {
field[i].checked = false; }
checkflag = 'false';
return 'Check All'; }
}
//  End -->
</script><input type=button value='Check All' onClick='this.value=check(this.form.list)'>".$region_opt."</div>
";
$content .="<br /><div>".$prev_list."<form action='".$_SERVER['PHP_SELF']."?do=".$do."' name='frm1' enctype='multipart/form-data' method='".$method."'>".$field_list."<br /><div><input type='hidden' name='filename' value='".$row[file]."' /><input type='hidden' name='key' value='".$id."' /><input type='hidden' name='do' value='".$do."' /><input type='submit' value='".$action_text."' class='button' /></div></div>";
?>

Link to comment
https://forums.phpfreaks.com/topic/75527-checkbox-help/#findComment-382106
Share on other sites

all i can say there is a problem with

 

if ($row[asia_pacific] == $row_region[keyid] || $row[EMEA] == $row_region[keyid] || $row[greater_china] == $row_region[keyid] || $row[latin_america] == $row_region[keyid] || $row[north_america] == $row_region[keyid] || $row[region] == $row_region[keyid]) {

 

how is $row being populated, from where does it come

 

Link to comment
https://forums.phpfreaks.com/topic/75527-checkbox-help/#findComment-382113
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.