0

Hi,
What i want is to have a checkbox area where the items i select are stored in a array. Im guessing there should be a some code to find out what has been checked.
Any help with this would be greatly appreciated.

echo '<form action="myown3.php" method="post" name="domaintest" action="_self">';
	
	echo '<input name="submitform" type="submit" value="Submit Domain Info">';
		foreach($domains->domainName as $value) {
echo (' <label><input type="checkbox" name="domain_custom" value="'.$value.'" id="'.$value.'">'.$value.'</label><br>');
		}	
	echo '</form>';
3
Contributors
4
Replies
7
Views
7 Years
Discussion Span
Last Post by tyrium
0

Hi,
What i want is to have a checkbox area where the items i select are stored in a array. Im guessing there should be a some code to find out what has been checked.
Any help with this would be greatly appreciated.

echo '<form action="myown3.php" method="post" name="domaintest" action="_self">';
	
	echo '<input name="submitform" type="submit" value="Submit Domain Info">';
		foreach($domains->domainName as $value) {
echo (' <label><input type="checkbox" name="domain_custom" value="'.$value.'" id="'.$value.'">'.$value.'</label><br>');
		}	
	echo '</form>';

are you looking for this?

$box=$_POST['box'];

while (list ($key,$val) = @each ($box)) {
echo "$val,";
}

echo "<form method=post action=''>";
echo "<table border='0' cellspacing='0' style='border-collapse: collapse' width='100' >
<tr bgcolor='#ffffff'>
<td width='25%'><input type=checkbox name=box[] value='John'></td>
<td width='25%'>&nbsp;John</td>
<td width='25%'><input type=checkbox name=box[] value='Mike'></td>
<td width='25%'>&nbsp;Mike</td>
<td width='25%'><input type=checkbox name=box[] value='Rone'></td>
<td width='25%'>&nbsp;Rone</td>
</tr>
<tr bgcolor='#f1f1f1'>
<td width='25%'><input type=checkbox name=box[] value='Mathew'></td>
<td width='25%'>&nbsp;Mathew</td>
<td width='25%'><input type=checkbox name=box[] value='Reid'></td>
<td width='25%'>&nbsp;Reid</td>
<td width='25%'><input type=checkbox name=box[] value='Simon'></td>
<td width='25%'>&nbsp;Simon</td>
</tr>

<tr><td colspan =6 align=center><input type=submit value=Select></form></td></tr>
</table>";
0

are you looking for this?

$box=$_POST['box'];

while (list ($key,$val) = @each ($box)) {
echo "$val,";
}

echo "<form method=post action=''>";
echo "<table border='0' cellspacing='0' style='border-collapse: collapse' width='100' >
<tr bgcolor='#ffffff'>
<td width='25%'><input type=checkbox name=box[] value='John'></td>
<td width='25%'>&nbsp;John</td>
<td width='25%'><input type=checkbox name=box[] value='Mike'></td>
<td width='25%'>&nbsp;Mike</td>
<td width='25%'><input type=checkbox name=box[] value='Rone'></td>
<td width='25%'>&nbsp;Rone</td>
</tr>
<tr bgcolor='#f1f1f1'>
<td width='25%'><input type=checkbox name=box[] value='Mathew'></td>
<td width='25%'>&nbsp;Mathew</td>
<td width='25%'><input type=checkbox name=box[] value='Reid'></td>
<td width='25%'>&nbsp;Reid</td>
<td width='25%'><input type=checkbox name=box[] value='Simon'></td>
<td width='25%'>&nbsp;Simon</td>
</tr>

<tr><td colspan =6 align=center><input type=submit value=Select></form></td></tr>
</table>";

Yea something like that, but there are over 2000 domain names and more and more are added all the time.

0

Great help muralikalpana,

This is the code i got so far

$box=$_POST['box'];

while (list ($key,$val) = @each ($box)) {
echo "$val,";
}

echo "<form method=post action=''>";
foreach($domains->domainName as $value) {
echo "<input type=checkbox name=box[] value='".$value."'>";
echo "&nbsp;".$value."<br>";
}
echo "<input type=submit value=Select></form>";

There are over 2000 domain names so i was wondering if there is a way to format it in a table so once it reaches something like 200 domains the table will continue on a second column and so on...

This question has already been answered. 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.