RE: [PHP] Need to maintain the integrity of the checkbox

From: Date: Thu, 29 Jul 2004 14:48:19 +0000
Subject: RE: [PHP] Need to maintain the integrity of the checkbox
Groups: php.general 
Request: Send a blank email to php-general+get-192195@lists.php.net to get a copy of this message
Example of form: <td height="52" align="left" valign="middle"><input type="checkbox" name="wbc_Money" value="$5000"> Power of Money Series ($5000) <img src="images/sold_Out.gif" border="0">Power of Politics ($3500)<br> <input type="checkbox" name="wbc_Wine" value="$1000"> Power of Wine &nbsp;&nbsp; <input type="checkbox" name="wbc_Golffall" value="$3500"> Power of Golf (Fall) Series ($3500)<br> <input type="checkbox" name="wbc_Golfspring" value="$3500"> Power of Golf (Spring) Series ($3500)</td> So the dollar amounts are the same for three of the four events, but this is just a snippet of about 20 items. If I take out the dollar amounts, and just populate an array with what are now the descriptive names, I can assign dollar amounts in the checkout script. Am I on the right track? -----Original Message----- Subject: RE: [PHP] Need to maintain the integrity of the checkbox [snip] Your right, I didn't explain fully. If I have two events where the value="$5", then after I have looped thru the array I know they want to pay the $5, but not which event that goes to because multiple events are that value. What I'm thinking I'll do is make one array and give each event a #, then after checking for the selected checkbox, validate which number and pass thru the event and corresponding dollar amount. Sound like the best solution? If not, I hope I have explained a little more precise. [/snip] A. Always reply back to the list in case the responder is no longer available which may leave you hanging. 2. Even though multiple events have the same value ($5) they are listed in the POST array according to the name the event input was given in the form. You do not need to do the above unless you have a badly done form. Why don't you send the code from the portion of the form we are talking about and we can help better.

« previous php.general (#192195) next »