law Posted February 14, 2008 Share Posted February 14, 2008 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> Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted February 14, 2008 Share Posted February 14, 2008 <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> Quote Link to comment Share on other sites More sharing options...
law Posted February 14, 2008 Author Share Posted February 14, 2008 thank you very much.. i feel like a complete noob now lol! Thank you! (for anyone who might do a search on it later onclick='document.YOURFORMNAME.submit()' is what you need to add to make it auto submit!) Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted February 14, 2008 Share Posted February 14, 2008 Your Welcome - Glad To Help Out Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.