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
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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.