this is a very quick example of the kind of content I will have. <form> Required bit rate <select> <option>128kbps</option> <option>192kbps</option> <option>240kbps</option> <option>320kbps</option> </select><br /> Required listener ammount <select> <option>up to 100</option> <option>up to 200</option> <option>up to 400</option> <option>400+</option> </select><br /> Auto DJ? <select> <option>Yes</option> <option>No</option> </select> </form> Code (markup): what i need is for the form to detect the value selected in the <option> and, depending on which are selected, add a set amount of money for each <option> and give a final total at the end =]
I have made something like this for the advertisement page for my iphones website. I made an array of prices in the config file and set the select values for each drop down to 0-4 (I have 5 options). then when the form is submitted I have $array[$dropdown_value] for each of the options. then you form your equation $total = $array[$dropdown_value]*$array2[$dropdown_value2]. This is way you insert a number to select the right value out of the array and then performs a math equation. If you look at the advertising page on http://myiphonebackgrounds.com you may get a better idea of what Im talking about. I use this to generate a paypal payment button. A second option is to set each drop down value to the actual money amount then just perform the operation. using an array allows you to change the prices faster. If you will give me a link on your website I will make you a quick script to do all of this for you. PM me if your interested. edit: I just noticed in your code your missing the value attribute <option value="0" selected>Top Banner</option> (ex. from my website)
I think that the only you can do this is with javascript "document.write(...". But do you need to do this in a php script?
Well, looks like you can't even properly structure the html (the selects have no name, the options no value) so it's best if you place this in the buy & sell (hire) section, unless there is a generous soul at there that wants to do this all for you.
neither one of you seems very helpful especially since I already offered to help. In addition its quite easy and I can do it in php because that is exactly how I generate my paypal buttons. It does seem like he may need someone to help him because his code is missing several things. Try using Dreamweaver to generate your forms.
Sorry, I'm just not much of a fan of people asking for complete solutions / scripts when they don't know much if any PHP. This forum is intended for people that are trying to learn PHP or want help with a specific bug. Otherwise, the user should just hire someone. Anyway, I think it's great of you to help the user with this. I just don't want to encourage threads like these.
thankyou girlzlover12, i will pm you shortly with my website address. as for the other slightly less concerning people... i know what i am doing with forms, however as i said it was a quick example of what i need, i know that they needed the values and other information to work once its online, i was just showing how i wanted it =]
no problem man, I think that I just misunderstood you, because I was searching for more information to be able to help you. good luck with your solution.