Jump to content

Checkboxes processing a form?


law

Recommended Posts

Ok my code works just fine like it is.. how can i make the check box process the form instantly without the user having to click the submit button??

 

<div id="stuff">
<?php
//	a table showing the users who have and have not payed so that they can be deleted from the database
include_once("./dbconfig.php");
$q="SELECT * FROM members WHERE id > 0";
$sql=mysql_query($q);

if ($_GET['userpaymenterror']){
echo '<font color=orange>The user with an ID of the above listed error number does not meet the requirements in order to post their payment.</font>';
}
echo "<table border=1 align=center><CAPTION ALIGN=TOP><B>Member Table!</B></CAPTION>
<tr align=center>
<td><b>ID</b></td>
<td><b>Nickname</b></td>
<td><b>Email</b></td>
<td><b>Name</b></td>
<td><b>Payment</b></td>
<td><b>Picks</b></td>
<td><b>Refferals</b></td>
<td><b>Confirm Pay</b></td>
</tr>";
			$rcount="0";
			$color1 = "#003300";
			$color2 = "#000066";

while ($row=mysql_fetch_array($sql)) {
$rcolor = ($rcount%2)?$color1:$color2;
$nickname=$row['nickname'];
$email=$row['email'];
$name=$row['name'];
$payment=$row['payment'];
$picks=$row['picks'];
$refferral=$row['refferralamount'];
$userid=$row['id'];
$usernumber=$userid['id'];
echo "
<tr align=center><form name='Payment' action='./paidconfirmed.php' method='post' enctype='multipart/form-data'>
	<td bgcolor=$rcolor align=left>$userid</td>
	<td bgcolor=$rcolor align=left>$nickname</td>
	<td bgcolor=$rcolor align=left>$email</td>
	<td bgcolor=$rcolor align=left>$name</td>
	<td bgcolor=$rcolor align=center>$payment</td>
	<td bgcolor=$rcolor align=center>$picks</td>
	<td bgcolor=$rcolor align=center>$refferral</td>
	<td bgcolor=$rcolor align=center><input type='checkbox' name='paid' value='$usernumber'>
	</tr>";
$rcount++;
}
echo "</table>
<p align=center>
<input type='submit' value='Submit'>    <input type='reset' value='Reset'>
</p>
</form>";
?>
</div>

Link to comment
https://forums.phpfreaks.com/topic/91008-checkboxes-processing-a-form/
Share on other sites

<div id="stuff">
<?php
//	a table showing the users who have and have not payed so that they can be deleted from the database
include_once("./dbconfig.php");
$q="SELECT * FROM members WHERE id > 0";
$sql=mysql_query($q);

if ($_GET['userpaymenterror']){
echo '<font color=orange>The user with an ID of the above listed error number does not meet the requirements in order to post their payment.</font>';
}
echo "<table border=1 align=center><CAPTION ALIGN=TOP><B>Member Table!</B></CAPTION>
<tr align=center>
<td><b>ID</b></td>
<td><b>Nickname</b></td>
<td><b>Email</b></td>
<td><b>Name</b></td>
<td><b>Payment</b></td>
<td><b>Picks</b></td>
<td><b>Refferals</b></td>
<td><b>Confirm Pay</b></td>
</tr>";
			$rcount="0";
			$color1 = "#003300";
			$color2 = "#000066";

while ($row=mysql_fetch_array($sql)) {
$rcolor = ($rcount%2)?$color1:$color2;
$nickname=$row['nickname'];
$email=$row['email'];
$name=$row['name'];
$payment=$row['payment'];
$picks=$row['picks'];
$refferral=$row['refferralamount'];
$userid=$row['id'];
$usernumber=$userid['id'];
echo "
<tr align=center><form name='Payment' action='./paidconfirmed.php' method='post' enctype='multipart/form-data'>
	<td bgcolor=$rcolor align=left>$userid</td>
	<td bgcolor=$rcolor align=left>$nickname</td>
	<td bgcolor=$rcolor align=left>$email</td>
	<td bgcolor=$rcolor align=left>$name</td>
	<td bgcolor=$rcolor align=center>$payment</td>
	<td bgcolor=$rcolor align=center>$picks</td>
	<td bgcolor=$rcolor align=center>$refferral</td>
	<td bgcolor=$rcolor align=center><input type='checkbox' name='paid' value='$usernumber' onclick='document.Payment.submit()'>
	</tr>";
$rcount++;
}
echo "</table>
<p align=center>
<input type='submit' value='Submit'>    <input type='reset' value='Reset'>
</p>
</form>";
?>
</div>

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.