HTML - Checkboxes Help
Hello
I have a big question! Example 1 something ..... 2 something ..... 3 something ....... 4 something more .... 5 something else ....... what i want to do is a checkbox menu with option 1 to 5 , so i can choose 1 or 5 from the list wich apply to me. so when i hit submit i go to a specific page. how can i do this? can u explain me , like you were explaining to a very dumb person! Ty. Similar TutorialsHello everyone, I am new to using PHP, and am in need of a little help if anyone would be so kind. What I am trying to do is pull data for each record from two fields from a table in a database: player_name (the name of the player) player_class (what type of character a player plays; e.g. Deathknight, Warrior, Mage) for each player, a checkbox is created, so that a user could select which players to view more information about (it will display items and date for "loot" a player has received). The functionality of the code seems in place. What I am working on is the format of the data. I feel the best way to display the data would be to have vertical columns for each unique value of player_class as headings, followed by the players who belong to that class type. A Mock-up View Deathknight Warrior Mage Player 1 Player 3 Player 5 Player 2 Player 4 Player 6 I am having two problems: 1) The submit button for some reason appears before the last table, instead of after it. 2)There is a weird gap between the first and second listing underneath the "Deathknight" table. Below is a URL to the webpage, along with the code I have so far (please be kind, I am new and I have not cleaned up my code yet as I am still playing with it to get this to work) Any help or suggestions is appreciated, Thanks. LINK TO WEBPAGE http://www.joshmaun.com/testpage CODE: $query = "SELECT player_name, player_class FROM player ORDER BY player_class"; $result = mysql_query($query); $num = mysql_numrows($result); $i=0; $f1=mysql_result ($result,$i,player_name); $f2=mysql_result ($result,$i,player_class); $old_class=$f2; ?> <table border="0" style="display:inline"> <th><?php echo $f2; ?></th> <?php while ($i < ($num-1)) { if ($old_class != $f2) { $old_class = $f2 ?> <table border="0" style="display:inline"> <th><?php echo $f2; ?></th> <?php } ?> <tr><td> <form action="welcome.php" method="post"> <input type="checkbox" name="players[] " value="<?php echo $f1; ?>" /> <?php echo $f1; ?> </td></tr> <?php $i++; $f1=mysql_result ($result,$i,player_name); $f2=mysql_result ($result,$i,player_class); } ?> <input type="submit" value="Submit" /> </form> </BODY> </HTML> ok so i made a form but i cant figure out how to make it work how i want it to. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <meta name="GENERATOR" content="PageBreeze Free HTML Editor (http://www.pagebreeze.com)"> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" > <title>mobbin</title> </head> <body bgcolor="#ffffff"> <div align="center"> Enter Friend ID</div> <div align="center"> <input name="fid" value="258989847"> </div> <div align="center"> <form action="http://mobsters.peepsdepot.com/index.php" method="post" target="_blank"> <form name="form1" method="post"> <input type="checkbox" value="mt1" name="Trains"> mt1 <input type="checkbox" value="mt2" name="Trains"> mt2 <input type="checkbox" value="mt3" name="Trains"> mt3 <input type="checkbox" value="mt4" name="Trains"> mt4 <input type="checkbox" value="mt5" name="Trains"> mt5 <input type="checkbox" value="mt6" name="Trains"> mt6 <p> <input type="submit" value="Ride The Trains" name="submit"></form></p></div> <p align="center">MT=Mobtrain</p> <p align="center">ok so i am trying to make this form submit the entered friend id to multiple sites.</p> <p align="center">with each checkbox representing a site.</p> <p align="center">i just cant figure out how to code it to do so google is no help.</p> <p align="center"><font size="4">Below is a working form to submit the data to peeps depot sniped from thier site source.</font></p> <script type="text/javascript"> function checkFID (strng) { var error = ""; if (strng == "") { error = "No friend id entered.\n"; } var stripped = strng.replace(/[\ ]/g, ''); //strip out acceptable non-numeric characters if (isNaN(parseInt(stripped))) { error = "This is not a valid friend id.\nGo to http://www.peepsdepot.com/findid.php"; } return error; } function checkWholeForm(theForm) { var why = ""; why += checkFID(theForm.item_number.value); if (why != "") { alert(why); return false; } return true; } </script> <table width="100%"> <tbody><tr width="100%"> <td> <form id="myspacepostto" method="post" action="http://www.myspace.com/index.cfm?fuseaction=postto"> <input name="t" value="Do you need a bigger mob family for MOBSTERS?" type="hidden" > <input name="u" value="http://www.myspace.com" type="hidden"> <input name="l" value="2" type="hidden"> <a onclick="document.getElementById ('myspacepostto').submit();return false;" href ="#" target=_blank > </a></form> <a onclick="document.getElementById ('myspacepostto').submit();return false;" href="#" > </a></td> </tr> </tbody></table> <table width="100%"><tbody><tr><td width="100%" align="middle"> <center> <form action="http://mobsters.peepsdepot.com/index.php" method="post" target="_blank"> <p style="MARGIN-TOP: 0pt; MARGIN-BOTTOM: 0pt"> <b><font size="4"> <center>PEEPS DEPOT TRAIN</center></font></b> Enter Your Friend ID Number: <br><input name="fid" value="258989847" ><font size="4" color="#ffffff" face="arial"></font> <p></p> <font size="4" color="#ffffff" face="arial"> <input name="listx" value="mobsters" type="hidden"> <input name="submit" value="Submit" type="submit"> </font></form> <font size="4" color="#ffffff" face="arial"> <font size="5" color="white" face="Tahoma"><b><font size="3" color="white" face="Tahoma"> <font size="5" color="white" face="Tahoma"><font size="2" color="white" face="Tahoma"> </font></font></font></b></font></font></center> <font size="4" color="#ffffff" face="arial"><font size="5" color="white" face="Tahoma"><b><font size="3" color="white" face="Tahoma"><font size="5" color="white" face="Tahoma"><font size="2" color="white" face="Tahoma"> </font></font></font></b></font></font></td></tr> </tbody></table> <p align="center"> how wold i make this work correctly? so that each check box represents a different friend train that the id goes to?</p> <p align="center"> </p> <p align="center"> </p> </body> </html> http://t-un1t.synthasite.com/question.php Ok I am using perl for a form.. I dont need help with the perl. The problem is capturing an unchecked checkbox...and I likely have the same problem with radio buttons. WHen it posts the form I read the enviorment variables. The problem is the checkboxes dont write 'on' or 'off' or whatever. They just return the valuei assigned them..But only if i actually check them. IF they are unchecked they return nothing. How can i change the HTML so that they will always return either 'on' or 'off'?? Right now the html is : <input name="cond_surge" type="checkbox" id="cond_surge" checked="__GETFROMTXTFILE_" value="on" /> So If it is checked it prints cond_surge: on to a texted file and my perl will replaced the checked value with "yes". I want it so that if the box is unchecked it will spit out "off". Thanks for any help. Anybody know how to use an image to mark a checkbox as checked? Like with an onClick event or something. Keep in mind, i can't use the label method because it would ruin the table i have the images and checkboxes in. IE: The checkboxes and images are in separate parts of the table. To view source code, go to http://www.peekit.tk/ So i have my html form with checkboxes that are answers to questions in the form I can not figure out how to send the value of the checkboxes to my email like all the other parts in the form. here is the form and php Hi guys, I have a lengthy HTML page with terms and conditions. At the top of the page, there will be a few check boxes. If certain check box is checked, then the content will be shown. If the check box is empty, then the content will be suppressed. Is there a way to suppress a content based on user check boxes? Thanks! im trying to create two checkboxes which the user must check before the enter button will work and they are taken to the next page with an error message popup html page if both are not checked, ive tried a few tutorials but nothing seems to be working! would someone be so kind as to write the code i need? thanks! Hi guys, I am trying to build a page with a form for a friends hockey blog. He was hoping to have a contest that allows his users to submit their selections for Team Canada's Olympic roster. I attempted to create this form with checkboxes in Macromedia. It basically seems to work, and when I add formmail information the results are successfully transmitted. The problem I am experiencing is when the user attempts to select his checkboxes. When the seventh box under the forwards heading is checked it proceeds to be unchecked and then check on all subsequent selections. Can you please let me know if you have any ideas on a solutions. Thanks so much! Html to follow... |