HTML - Please Help Me! Problem: Multiple Calculations From Multiple Drop Boxes Need Adding
Please help. This is what I have so far http://bartletagency.com/m/x2.php
Now, obviously with business cards there many different options. I need something to calculate on the side the total after picking each drop box option, or if easier, after hitting "calculate total." (preferably with the numbers in a table so I can make it appear by itself right underwear the send button) . Example: 1000 business cards in blue, say, would need to come up at 50 dollars if they pick 3-1, but if they pick 3-22 it needs to come up 60 dollars if they pick the other color, green, and pick 3-1, the label would need to turn to $55.00, if they pick 3-2 with the color green the label would need to say $65.00 how can i do this please? here is the code I have which made up the PHP file i linked you to above. code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <title>Lesson 3</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php if ($_SERVER['REQUEST_METHOD'] != 'POST'){ $me = $_SERVER['PHP_SELF']; ?> <h1 align="center">Business Cards</h1> <form name="form1" method="post" action="<?=$me?>"> <table border="0" align="center" cellpadding="5" cellspacing="0"> <tr> <td align="right" valign="middle">Quantity:</td> <td><select name="Quantity: "> <option value="1000">1000</option> <option value="2500">2500</option> <option value="5000">5000</option> <option value="10,000">10,000</option> </select> </td> </tr> <tr> <td align="right" valign="middle">color</td> <td><select name="color"> <option value="blue">blue</option> <option value="green">green</option> </select> </td> </tr> <tr> <td align="right" valign="middle">3</td> <td><select name="3"> <option value="small">3-1</option> <option value="medium">3-2</option> </select> </td> </tr> <tr> <td> </td> <td><input type="submit" name="Submit" value="Send"> </td> </tr> </table> </form> <?php } else { error_reporting(0); // initialize a array to //hold any errors we encounter $errors = array(); // test to see if the form was actually // posted from our form $page = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']; if (!ereg($page, $_SERVER['HTTP_REFERER'])) $errors[] = "Invalid referer<br>\n"; // check to see if a name was entered if (count($errors)>0) { foreach($errors as $err) echo "$err<br>\n"; echo "<br>Please use your browser's Back button to fix."; } else { // no errors, so we build our message switch($_POST['color']){ case 'red': $recipient = 'mathew420@gmail.com'; break; case 'green': $recipient = 'mathew420@gmail.com'; break; case 'blue': $recipient = 'mathew420@gmail.com'; break; default: $recipient = 'mathew420@gmail.com'; } $subject = "Widget On Line Order"; $from = stripslashes($_POST['Name']); $msg = "Message sent by $from\n"; $msg.="\nSize: ".$_POST['size']; $options=$_POST['options']; $msg.="\nOptions:"; if ($options) for ($i=0;$i<count($options);$i++) $msg.= "\n- $options[$i]"; else $msg.="\n- None"; $msg.="\nColor: ".$_POST['color']; $extension=($_POST['extension'])?"Extension: Yes":"Extension: No"; $wallmount=($_POST['wallmount'])?"Wallmount: Yes":"Wallmount: No"; $deskmount=($_POST['deskmount'])?"Deskmount: Yes":"Deskmount: No"; $msg.="\n$extension\n$wallmount\n$deskmount"; $msg.="\n".stripslashes($_POST['MsgBody'])."\n"; if (mail($recipient,$subject,$msg)){ echo "<p>Thanks for your order!</p>"; echo nl2br($msg); } else echo "An unknown error occurred."; } } ?> </body> </html> thanks so much Similar TutorialsOk, you know how you can drag the mouse over any amount of normal text and the text gets that blue border around it. Try doing the same with an input box and you can only highlight the text of one input box at a time. How can I highlight the text from multiple form input boxes at once? Hello all! I want to have a page with multiple drop-down menus. The user will select for example "type of car" and a drop-down menu of 3-4 colors will appear... And then, if the user selects one of these colors, another drop-down menu will appear with the available brands of cars for the respective colour... Can you give me hints on how to start? Hi All, I'm trying to create an information page with HTML whereby people can find an address of a store based on the conditional dropdown boxes selected. Based on the choices selected, it would display the results. E.g. Dropdown 1: Select State Dropdown 2: Select Retail Store Output: Address of the retail store (displayed on the same page) I came across a solution in one of the threads for making multiple conditional dropdowns for a form. The code given works extremely well but I'm not sure how to have a text output result on the same page. Can anyone help? Thanks a bunch in advance! HTML Code: <script type="text/javascript"> // Place in this array the ID of the element you want to hide var hide=['the_minutemen','Planet_Smashers','crass','Madonna', 'the_misfits','next','id2']; function setOpt() { resetOpt(); // Call the resetOpt function. Hide some elements in the "hide" array. for(var i=0,sel=document.getElementsByTagName('select');i<sel.length;i++) { sel[i].onchange=function() { if(this.parentNode.tagName.toLowerCase()!='div') resetOpt(); // Hides the elements in "hide" array when the first select element is choosen try { document.getElementById(this.value).style.display=''; } catch(e){} ; // When the value of the element is not an element ID } } } window.addEventListener?window.addEventListener('load',setOpt,false): window.attachEvent('onload',setOpt); function resetOpt() { for(var i=0;i<hide.length;i++) document.getElementById(hide[i]).style.display='none'; // Hide the elements in "hide" array } </script> Artist: <select> <option value="the_minutemen">The Minutemen</option> <option value="Planet_Smashers">Planet Smashers</option> <option value="crass">Crass</option> <option value="Madonna">Madonna</option> <option value="the_misfits">The Misfits</option> </select> <div id="the_minutemen"> The Minutemen Album: <select> <option value="album">The Minutemen album1</option> <option value="next">Show next 'select' element</option> <option value="album">The Minutemen album3</option> <option value="album">The Minutemen album4</option> <option value="album">The Minutemen album5</option> </select> </div> <div id="Planet_Smashers"> Planet Smashers Album: <select> <option value="album">The Planet Smashers album1</option> <option value="id2">Show element with the id of 'id2'</option> <option value="album">The Planet Smashers album3</option> <option value="album">The Planet Smashers album4</option> <option value="album">The Planet Smashers album5</option> </select> </div> <div id="crass"> Crass Album: <select> <option value="album">Crass Album1</option> <option value="next">Show next 'select' element</option> <option value="album">Crass Album3</option> <option value="album">Crass Album4</option> <option value="album">Crass Album5</option> </select> </div> <div id="Madonna"> Madonna Album: <select> <option value="album">madonna Album1</option> <option value="id2">Show element with the id of 'id2'</option> <option value="album">madonna Album3</option> <option value="album">madonna Album4</option> <option value="album">madonna Album5</option> </select> </div> <div id="the_misfits"> The Misfits Album: <select> <option value="album">the_misfits Album1</option> <option value="album">the_misfits Album2</option> <option value="album">the_misfits Album3</option> <option value="id2">Show element with the id of 'id2'</option> <option value="album">the_misfits Album5</option> </select> </div> <div id="id2"> Element with an ID of "id2" <select> <option>Opt1</option> <option>Opt2</option> <option>Opt3</option> </select> </div> <div id="next"> "Next" element <select> <option>Opt1</option> <option>Opt2</option> <option>Opt3</option> </select> </div> Hi there I checked through a bunch of this forum but I can't find anything on this topic. If it's already been addressed, I'd be thankful if you could point me to the thread. If not, this is my problem.... I need to have 2 drop down menus in the same form, so that when the user clicks submit (OK in this case) both selected fields are posted.... Code: <form method="post" action="show.html"> <table> <tr> <td>Select a color</td> <td><select name=color"> <option value="red">red</option> <option value="green">green</option> <option value="yellow">yellow</option> <option value="orange">orange</option> <option value="purple">purple</option> <option value="blue">blue</option> </select> </td> </tr> <tr> <td>Select a shape</td> <td><select name=shape"> <option value="circle">circle</option> <option value="square">square</option> <option value="triangle">triangle</option> <option value="hexagon">hexagon</option> </select> </td> </tr> <tr> <td><input type="submit" value=" OK "></td> </tr> </table> </form> This code displays the drop downs perfectly but only the color is being posted to show.html It's something small but I can't figure this one out. I'm not sure if you can even have 2 drop downs with 1 submit button. Any and all assistance is greatly appreciated! Perkie Okay here is the previous thread that lead me to this issue. http://www.htmlforums.com/html-xhtml...tml#post670803 It solved my issues of opening a new window based off of the selection in a drop down, how ever I have 13 drop downs and the script from the above thread only allows one drop down to work. The drop downs will increase, is there any way to get them all to work. Thanks dt_gry Hi! I would like to create a drop down menu in HTML where the user can choose many options, not possible in simple HTML? Dharma The tutorial on how to make a search form with multiple search options was excellent! http://www.mediacollege.com/internet...ti-search.html However, is it possible to use radio buttons instead of a drop-down list? Can someone be kind enough to show me the code for it? Million thanks. Hey guys and thanks in advanced for helpin' me out with this one. Anyways, I'm building a sort of "Advanced" search functionality. I want to give the user the ability to select multiple checkboxes in different categories (forms) but to be able to account for each checkbox even though they are in different forms. For example a Newspaper might have a search for an article by: Code: <FORM>(form name = "formONE") Paper Type Weekly [] Daily [x] Monthly [] {SUBMIT BUTTON} </ FORM> <FORM> (form name = "formTWO") Location Upper East [] Null County [] Down South [x] {SUBMIT BUTTON} </ FORM> <FORM> (form name = "formTHREE") Article Section Lifestyle [] Sports [x] Weather [] Finances [] {SUBMIT BUTTON} </ FORM> SO looking at the above...If the user "checked" (I placed 'x' in there) those boxes...and clicked ANY of the submit buttons, I want to be able to pull-in EACH of the checked items from ALL THREE of the forms. What is happening now with my code, is I'm only getting the results for the form which I clicked the 'submit' button in. I know you might ask, "why not just put them in one form?"... but I have them in separate forms because I want the user to have the ability to "CHECK/UNCHECK ALL" for each category (i.e. Paper Type, Location, Article Section...) Is it as easy as just wrapping all of those forms in one GIANT form, and supply each submit button with the name of that GIANT form? I hope this makes sense, and let me know if you need anything else at all...it's the last piece of this search and I just want to get it out of the waY!! Thanks guys! Greetings I have this problem that i got a media player embedded to my pages using activeX controls, and i would like to make it work a little bit different. I need the player to display stream 1, first from location localhost:8800/uys.wma this takes 10 seconds, then it needs to open stream 2 from location localhost:8800/uys2.wma that takes 3 minutes and then finally it needs to display stream 3 as long as it takes. So how do i make the player play multiple streams after another. Also this player should start automaticly when someone enters the page... Please help! Also this needs to work in Firefox and IE... Anyone have source code for this kinda system and is there a script to prompt for plugin for firefox? Sir. Turhapuro Hey, I'm having a couple of problems which I'm hoping some of you may be able to help me with. Basically the background for the website which I am working on has 3 sections; a top section, a blankl middle section, and a bottom section. I have therefore designed the site using 3 tables, each table containing one row and 3 columns. Each table has one of the backgrounds, such that: A. The background of the top table is the top background. B. The background of the middle table is the blank, plain white background. C. The background of the bottom table is the bottom background. This method seems to work, however when I first implemented this design non of tyhe backgrounds displayed, so to get round this I entered some <br></br> tags which succesfully caused the backgrounds to display suitably. I continues the web design in FF, and completed it. When I then viewed the finished article in IE there were 2 top backgrounds, on middle section, and 2 bottom backgrounds. I fear I may be totally missing the point here! Can anyone help me out please. Let's say I have 2 drop down boxes. Both have the choices 10% to 100%. Can I make it so that depending on what % you choose the submit button takes you to certain links? I'm trying to do what this site did but without all of the country, keyword, sort by etc. I just want one category and the % boxes and that's all. I already have the necessary links so that's not a problem. Here is the page I am working on: http://pharosgroup.net/index.php?opt...=article&id=79 From Leadership Competency downward, I am trying to align those drop down boxes so that each of them are the same no matter how long or short the question is. It seems all questions that take up two lines have the boxes all the way to the right by default and its perfect just the way I want it! However I cannot get the rest to matchup correctly, any tips or help would be great! I do have Dream weaver also but cannot figure it out! I can also post the code if it will help. I have a custom order form where the choices available in one box should be conditional on another one. I want both the drop down boxes to display on the same page. For instance, the first box has regular, superior and deluxe. The second box would have red, orange, violet, indigo, blue. If user chooses regular, all colour options would be available.. If user chooses superior, red orange violet would be available If deluxe, only red available. How would I do this? How exactly can I make a drop down box (<select>) make an iFrame load something else? So that the iFrame displays new information but stays on the same page If this is not possible or to complicated how else could I do something of the same effect? Hey there, not sure if this is the right place to post this but here goes. (Did look to make sure but wasn't a 100% positive) Anyway, I'm pretty familiar with the basics of html. I can read it and understand what most of it says. My first question is, do you think frames would be a good idea here ??I don't work them often so I'm not too familiar with them but I do understand how they work. I was thinking just two side by side or would I need to do one on top & two side by side. Nothing would alter above the main image so it's why I didn't think it was necessary. But again, not an expert. Second question. On this on this page is more complicated. I know about drop down boxes but what I was thinking of have it has it is now except the dark purple not show until you click on the letter you want. (I know that sounds like a normal drop down box but I'm not sure how else to explain it) Just wondering if that was possible to do without it being too difficult. <3 thanks a lot everyone. I appreciate all help. Lilly First I am not sure if this is the right place to post this, it might need to be in a different language section. Sorry for that if it is. I need to create a set of drop down boxes, most likely 6. Each box needs to have 4-5 different options in it. There is no order in which they need to be set up because the user HAS TO be able to start with whatever box they want. From their choice in the first box, certain selections in the other drop down boxes would have to be eliminated. Same with the second, third and so on. There can be no predetermined order of what one they start with because not all the boxes will apply to every user. Another way to imagine the basic concept if I am not clear enough is go to any car website like kbb.com. When you first select the company who makes your car, Honda for example, the next box over will bring up a list of all the cars Honda makes. Then when you choose the car, Accord for example, the next box will give you the option of the manual or automatic and so on. I am kind of looking for this functionally, but I need it to be where you can start with any box and no matter what you choose in the first box, it does not eliminate all other choices, just 1 or 2 from each box (based on the selection). I know this is kind of hard to understand, it is even harder for me to describe. lol. If you can give me any help that would be wonderful, even if it is just a language this would be able to be accomplished in. I would really like there to be a web version for a website as well as a stand alone program to run on computers (this will probably be done in C# I am guessing). Thank you so much, Brian Stoiber Hey all, I've been looking all over the net for a tutorail about this, but I can't seem to find one. What I'm trying to do is make a drop-down box where you can select an option, press a submit button, and it'll open up a new window *or tab for firefox users* pertaining to that information, such as a site that I choose to link to it. This is the code I'm using for my option box <div align="left"> <select name="xfer" size="1" style="color:000000; background-color:226622; font-family:trebuchet ms; font-size:11px; border:thin solid "ffffff;> <option></option> </select> </div></form> I'm totally stumped here. Any help would be greatly appreciated! -Cheers, Billy Hi, I am looking for some help with HTML forms, namely forms which mainly comprise of drop-down boxes. I know how to create drop-down boxes in forms, though what I want is that each variable in the drop-down box should go to a different URL. For example, if someone selects "variable 1" and then clicks submit, it should go to a different URL than when they select "variable 2" and click submit. I have all the URL's, though I'm just not sure of how to make each variable go to a different URL. Can someone help me out with this? If anyone knows of a site which has something similar like this can you please direct me to it so that I can look at he source? Thanks. Hi all. I've been updating a website that now has a list that is getting to big and takes up abit of scrolling. Can anybody direct me to code that allows me create drop down boxes for each catagory that lists the html pages. When the user selects the page from within the drop down box it either goes straight to the page or they need to click "go". Cheers. Leroy |