HTML - Help With Making Dynamic Checkboxes
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. Similar TutorialsHello 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. 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> 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/ 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... I was wondering if there was any specific code that i could use to mkae a thumbnail of an image that leads to a larger image, without having to make 2 separate images. I am very new to html coding and so I don't no if this is even possible. But what I want to do is have a user click on an image or a button and have another image or text or whatever appear on the same window. I no about the onclick action and understand a little bit about forms. However I am at a real wall on this one. thank you Hi I've found a nice template of a website online (free). But i couldn't find a way to fully make the template RTL. Could anyone assist be with some basics? I could even upload the template. Thanks, Hello knowledgable HTMLforum gurus. I have a client that would like a blog feature on her site, so that she can update one of the pages with announcements, etc. Is there some free code anywhere that I can use to accomplish this? I'd like the code to be able to archive old entries and have a search function if possible... Also, I need to have the blog section fit into the same design scheme as the rest of the site that I will be creating, so outsourcing to blogspot or something like that is out of the question. Does anyone know of any freeware that can accomplish this? Thanks in advance, hous edit: please forgive the placement of this thread - not sure where this belongs. hi every one i thought some one can help me i no HTML but i want to make a online web gaming site like vicecitywars,forcewars,metrowars and 2453thegame. and i would like how no to make it and what to use and what els to know and explain well cos im beginner and i realy want to no how to so plz help ????? thank you for time I know about tables, but are there advance programming for certain condition? I mean if I want certain cells to certain lengths and so on? im just wondering if any1 uses programs other then google adsense... i have seen a few not many that look too promising... does any1 know any CPM (cost per 1000 hits) sites... i would like to have @ least 1 of those if i could find a decent site for them... Thanks... hi please check my site www.yourdesign.org and please could somebody tell me how i can stop it going all weird in IE, it looks fine in firefox cheers guys n gals is it possible to have div #1 which is 500 x 500 and div #2 which is also 500 x 500 directly above div #2 (rather than below or next to it)? i am thinking of using the z-index to making this happen... am i on the right track? so div #2 will have a z-index which is greater than that of div #1 Hello all. I am kinda a noobie at this, so dont get mad at me! How would i make a bkg not tiled? Im not exactly sure. Please help. Hi guys, I am building a site for a new company and they need a page with a form on it that a user can fill out, that gets sent to the company, which they use to send back a quote. So obviously the form will require fields for the users name and other important details. As for the actual info needed to make the quote, there are three different types of quote (so maybe three different forms would work?) The forms are as follows: Marine Type of boat: Length: Height to antifoul line: Hull: Material: Antifoul re-application: (yes/no) Marina location: Automotive Make: Model: Year: Type of strip: Condition: Rust: Blast location: Home location: Swimming Pool Type of pool: locaton: Size (m squared): Depth: Shape: Tiled: (yes/no) Re-paint: (yes/no) Blast location: This excel file also shows the forms required: http://www.mediafire.com/?33oxx0zf6tac8ap I would greatly appreciate it if someone showed me how i can make these forms using HTML. Thanks |