HTML - Help With Checkboxes In Tables
Hello 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> Similar TutorialsHi Normally, when you have more than one table in your code, the tables will be placed one under each other. Example: <table> ... </table> <table> ... </table> When you want the tables to be placed next to each other, you need to set the align attribute. Example: <table align="left"> ... </table> <table align="left"> ... </table> BUT: When you do it like in the 2nd example (tables next to each other), in Firefox, the tables will wrap to a new line if there is no more space. In Internet Explorer, the tables will not wrap. The result is a horizontal scrollbar or "hidden tables". Why this? How can I make the tables wrap also in Internet Explorer as it does in Firefox? Is it possible with a special CSS definition or with a special DIV/SPAN tag? Thanks for your help praiser Hey everyone, I'm new to these boards. Somewhat a newbie at web design, but I know basics. I'm looking to put 2 tables adjacent to each other inside another table. My problem is I can't get the tables to line up the way I want them to. I'll post a picture of how I want it to look, how it looks now and my code. How I want it to look: How it looks now: I want the tables to line up at the top and re-size according to each other so they're always aligned at the top. Code: coming in next 2 posts 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. 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 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 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/ 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. 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... 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! Has anyone heard of this software?: http://www.table2css.com/ I've been told that my site at http://www.ColoradoProcessServers.net was done with tables, and they're late 90's era stuff, which is why I'm having such trouble trying to get rid of white space above and below the row of logos on my page. Or would it be very hard for me to learn how to do a proper job of this myself, without attending college? ( don't have time or money ) Or might it not cost much to pay someone to work with me? I could send them code from the style.css and each page, and they could send it back converted without the tables, then I test it? Hi, I have some tables on a page and I am really really bad at them. I need help with this one page. What I am trying to do is to get the two tables to the right scooted over a little more to the center and wider. Im just trying to get it to look nice and centered. If anyone can help with this I would really appreciate it. Thanks I have a L shaped image that I want to put into a table as a whole rather than cut into to two oblongs. As I am not an expert I wondered if this would mean that the space surronding the L shapped image will not be accesble when place in the table.. I want to put txt into the recess against the right angle formed by the L I think that the <td><img src="Lshape"/></td > way that the table structure works that the L will have a rectangle around it and that this will prevent things butting close to it.. is there a way around it.. Apart from cutting the L shape into two pieces and putting a table within a table thanks Larry Hi there, Im relatively new to the HTML programming world, and can't for the life of me get this layout to work. Would someone mind making this table for me, and posting the code? I've made others, but for some reason cannot get my head round the rowspan feature... If anyone wouldn't mind making it, this is the layout I'm aiming for Edit: I apologise that image is so large. I have a table I created and I want to have a page that allows you to fill in text boxes to answer questions and then when submitted it will put the answers in the correct cell of the table. I have no idea how to do this and am limited in my html skill. If some one could point me in the right direction I would appreciate it greatly. http://www.roleplayingmaps.net/sheet.htm This is the table I have already created. Thanks for taking the time to read. I have been working on rebuilding a website using my somewhat dated knowledge of html. It works fine for my daily needs but I got to a page where I needed a table in a table. What I did looks great in Firefox, but when I check it in IE7 it turns into a nightmare. I'm stuck. Can anyone shed any light on where I turned left when I should have turned right (or something of that sort)? I tacked the page onto another site for now. It's at: http://www.cincinnatigolfcourseguide...m-ductwork.php Id like to put multiple tables on one of my web pages. Each would contain an RSS feed, but how do i get the tables in the same row ? id like it to look kinda like this in my page. <table1> <table2> <table3> <table4> <table5> <table6> <table7> <table8> <table9> Can anyone tell me how to achieve this? Thanks Jake Hey htmlforum and members can someone help me out with a carousel for image *small_blank.png*..(just start me off) thanx... -tikki- PHP Code: <tr> <td colspan="3" rowspan="2"> <img src="imagesxx/small_blank.png" width="234" height="83" alt=""></td> <td> <img src="imagesxx/spacer.gif" width="1" height="74" alt=""></td> </tr> i have the script needed http://www.dynamicdrive.com/dynamici.../carousel2.htm Hey, i'm trying to make a simple site, and right now i have one page with a table centered. That all works good, and when you change the size of your webpage, the table always stays centered. My problem is i would like to do this with DIV, because CSS allows more positing control. Yet, when i put a DIV table somewhere when i change the size of my webbrowser the table just disapears off to the site instead of staying centered (even thou its not set to stay centered) I geuss a better question would be how can i control where the table is, but keep it relitive to the size of the window? With CSS or with HTML. Thanks. I've been having some issues with my site. It looks fine in IE but it doesn't look correct in Firefox, Opera and Safari. The tables are misaligned and I am at a total loss. Can anyone help me out. Thanks here is the link; http://wwwdotcapleeconsultingdot.com |