HTML - Calculation Form
Hello,
I worked very hard on creating this calculation form. Now I am trying to input some radio buttons (MALE/FEMALE). The formulas are different: MALE function formula(x,y){ return ((x+y-1)/12); FEMALE function formula(x,y){ return ((x+y+1)/12); Can someone please help me?? I gave up trying after 7 h. I can`t do this anymore, it seems impossible to me. <script type="text/javascript"> function $(el) { return document.getElementById(el); } function formula(x,y){ return ((x+y-1)/12); } function check() { var x=parseInt($('x').value); var y=parseInt($('y').value); if($('x').value.length>0 && $('y').value.length>0) { $('result').value=formula(x, y); } } </script> <table> <tr><td width="50%"><font face="arial" size="2" color="#FFCCFF"><b><input type="radio" name="male" value="male"checked>MALE</b></font></td> <td width="50%"><font face="arial" size="2" color="#FFCCFF"><b><input type="radio" name="female" value="female">FEMALE</b></font></td></tr> <tr><td> x:</td><td><input type="text" id="x" onclick="this.select()"/></td></tr> <tr> <td> y:</td><td><input type="text" id="y" onclick="this.select()"/></td></tr> <tr><td> Rezult <input name="button" type="button" onclick="check()" value="calculate" /></td><td><input id="result" type="text" disabled style="width:100px; height:40px; text-align:center; vertical-align:middle"/></td> <tr><td> </td> <tr> <td> </td> </table> </td> THANK YOU!!!!! Similar Tutorialshi i m new to programming i need a program for age calculation whch displays years months hours minutes , each must b displayed seperately, n the input method must b shown with examples like how to input the dates, ex dd/mm/yy Enter your date of birth Month � Date� Year You have been living for: In months: In weeks: In days: In hours: In minutes: In seconds: In Milliseconds: Your next birthday will be in: and this program must b embeded in any website by users Could someone please tell me how to do the simplest of calculations on a webpage? Take in a few values - three or four only. Do some multiplying on them. Output the results to the page. I know it can't be done in html. I feel it is probably a javascript candidate. But how, exactly, to put the two together and do it? Sorry to be so dumb. We all gotta start somewhere. Hey guys new here so thank you in advance for any help. I am building my first site and I want to have a form on it where users of the page can submit info into a form and then be provided info about that info. For example: How many A's do you want to buy? User inputs a number or selects from a drop down of numbers How many B's do you want to buy? User inputs a number or selects from a drop down of numbers Then I want to the user to see instant feedback on the site that says "Your total is $x.xx" Is this possible? Thanks again Hey guys! I'm working on a web page for a loan redemption calculation. I want people to enter the loan amount, the interest rate, and the monthly redemption rate. The program should tell them then how many month it takes to pay back the entire loan and how much accumulated interest they have to pay. I tried it with this loop : (interestRate , loan and redemption are defined before this loop) Code: monthCount = 0 begOfMonth = loan interest = 0 valueWithoutInterest = 0 endOfMonth = 1 accInterest = 0 for(i=1;endOfMonth>0;i++){ interest = begOfMonth * interestRate / 1200 accInterest = accInterest + interest valueWithoutInterest = begOfMonth + interest endOfMonth = valueWithoutInterest - redemption begOfMonth = endOfMonth monthCount = i } document.getElementById("resLoan").innerHTML = loan document.getElementById("resInterest").innerHTML = interestRate document.getElementById("resRedRate").innerHTML = redemption document.getElementById("resIntPayed").innerHTML = accInterest document.getElementById("resRuntime").innerHTML = monthCount for some reason, this loop is infinite. When i modify the loop to calculate only 1 month, the numbers are correct. When i let it calculate 2 month, the accInterest explodes to a completely wrong value. I checked it so many times and i just cant find any mistake... I hope one of you guys can help me. thanks in advance! ps: sorry for the grammar Hello All, I am new to this, and not sure if this is the right forum. But, I have a simple web page with drop down menus where I can put values for a calculation. I would like to have the values saved as an input file for a python script that resides on the server. I would like the input file to be created and then the script executed and the output appear as a new page. I have googled this and have come up empty. Can someone point me in the right direction. Thanks, Bryan script completed, thx Hi all, I have a simple newsletter form, so just the email field and a submit, what I would like to do is to send this data to a larger subscriber form, so one that has name, email (with the data previously entered already added), list to subscribe to etc. Can this be done? Thanks I have a form with a number of elements. One of these elements is: <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc-subscribe.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> Clicking on that element makes the form submit. But if I add a similar element: <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc-subscribe.gif" border="0" name="submit2" alt="Make payments with PayPal - it's fast, free and secure!"> ...clicking on that also makes the form submit. So was wondering if anyone knew what the rules were for which elements make a form submit? Cheers, James I have a simple signup form on my site that I want to pass the input to the larger signup form. Here is the code for the simple form: <form action="http://bigdogcattle.com/?a=Cattle_Mailing-List_SignUp" method="post" accept-charset="UTF-8"> The larger signup form is located he http://bigdogcattle.com/?a=Cattle_Mailing-List_SignUp I want the email address from the simple form to move to the larger form when the submit button is pressed. Ideas? HTML Code: <form method="post" action="mailto:xxxxxxxx@xx.com "> <table class="text3"> <tr><td valign="top" width="140">Voornaam:</td><td><input name="requiredvoornaam" type="text" id="requiredvoornaam" class="veld" size="30" /></td></tr> <tr><td valign="top" width="140">Achternaam:</td><td><input name="requiredachternaam" type="text" id="requiredachternaam" class="veld" size="30" /></td></tr> <tr><td valign="top">E-mail:</td><td><input name="requiredemail" type="text" id="requiredemail" class="veld" size="30" /></td></tr> <tr><td valign="top">Telefoonnummer:</td><td><input name="requiredtelefoonnummer" type="text" id="requiredtelefoonnummer" class="veld" size="30" /></td></tr> <tr><td valign="top">Adres:</td><td><input name="requiredadres" type="text" id="requiredadres" class="veld" size="30" /></td></tr> <tr><td valign="top">Woonplaats:</td><td><input name="requiredwoonplaats" type="text" id="requiredwoonplaats" class="veld" size="30" /></td></tr> <tr><td valign="top">Aankomstdatum:</td><td><select name="adag" id="adag"> <option value="Dag">Dag</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> <option value="31">31</option> </select> <select name="amaand" id="amaand"> <option value="Maand">Maand</option> <option value="Januari">Januari</option> <option value="Februari">Februari</option> <option value="Maart">Maart</option> <option value="April">April</option> <option value="Mei">Mei</option> <option value="Juni">Juni</option> <option value="Juli">Juli</option> <option value="Augustus">Augustus</option> <option value="September">September</option> <option value="Oktober">Oktober</option> <option value="November">November</option> <option value="December">December</option> </select> <select name="ajaar" id="ajaar"> <option value="Jaar">Jaar</option> <option value="2008">2008</option> <option value="2009">2009</option> <option value="2010">2010</option> </select> </td></tr> <tr><td valign="top">Vertrekdatum:</td><td><select name="vdag" id="vdag"> <option value="Dag">Dag</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> <option value="31">31</option> </select> <select name="vmaand" id="vmaand"> <option value="Maand">Maand</option> <option value="Januari">Januari</option> <option value="Februari">Februari</option> <option value="Maart">Maart</option> <option value="April">April</option> <option value="Mei">Mei</option> <option value="Juni">Juni</option> <option value="Juli">Juli</option> <option value="Augustus">Augustus</option> <option value="September">September</option> <option value="Oktober">Oktober</option> <option value="November">November</option> <option value="December">December</option> </select> <select name="vjaar" id="vjaar"> <option value="Jaar">Jaar</option> <option value="2008">2008</option> <option value="2009">2009</option> <option value="2010">2010</option> </select> </td></tr> <tr><td valign="top">Welke huisje:</td><td><select name="huisje" id="huisje"> <option value="1">.____Huisje Zomerbries_____.</option> <option value="2">.____Huisje Wervelwind_____.</option> <option value="3">.____Huisje Tornado________.</option> </select> <tr><td valign="top">Aantal personen:</td><td><select name="aantal personen" id="aantal personen"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> </select> <tr><td valign="top">Overige vragen:</td><td><textarea name="bericht" rows="6" cols="23" id="bericht" class="area"></textarea></td></tr> <tr><td valign="top"></td><td><input type="submit" name="sendFormButton" value="Verzenden" id="sendFormButton" /></td> </tr> </table> </form> </td></tr></table> This is what i get once tested... its out of order... Help me plz...... Im not good with those thingz.. Hi guy, I tried to do some googling before i come to here. the problem is that i don't know what are the name or keyword for this, therefore i cannot find any relevant result. Let's say, i have many same html with different file name file filled with tables that i dont' want users to open and use it. Can i create another separate forms using html to fill in the blanks on the table cell maybe after i click submit button? Or it's easier to use VB to write a program and do the job? Please help. Hi, I have a tricky problem that you kind people might be able to solve. I want to put one set of forms inside another set of forms without them interfering with each other. At the moment, the form I've created inside the other form is not responding. The code, when simplified, looks something like this: <FORM (1)> <FORM (2)> </FORM> </FORM> Am I trying to do the impossible or is there a way to overcome this problem? Thanks! / Stefan So i want to Post and Get in the same form for reasons of keeping the URL looking clean. I need to pass a PHP array through to the next page, and I don't want random gibberish in the URL. So, I can just Post this, but this is for a search page, and it would be nice to Get their search query for the reasons of the advantage of Get over Post, and because it looks better in my opinion. Anyways. The thing I am posting takes no user input, and it is defined in the beginning of the page. The thing I want to Get is user defined in a textbox. So, I need the method of the Form to be Get, but is it possible to also Post something? Thanks, If i wasn't clear i'm sorry and i'll try to explain it better. I have created a form with multiple different buttons, the first button is required to open a pop up box to show a list of people who live in a certain postcode. HTML Code: <div id="form"> <form name="f1" method="post"/> <p> ID: <br/> <input name="ID" type="text" value="Leave Blank" /> </p> <p> Name: <br/> <input name="Name" type="text" /> </p> <p> Address: <br/> <input name="Address" type="text" /> </p> <p> Postcode:<br/> <input name="Postcode" type="text" /> <input type='submit' value='Check' onclick="popup('popUpDiv')" /> <p><a href="#" onclick="popup('popUpDiv')">Find Person</a></p> </p> <p> Telephone: <br/> <input name="Telephone" type="text" /> </p> <p> Mobile: <br/> <input name="Mobile" type="text" /> </p> <p> AltTelephone: <br/> <input name="AltTelephone" type="text" /> </p> <p> Email: <br/> <input name="Email" type="text" /> </p> <p> Date: <br/> <input name="Date" type="text" /> </p> <p>Notes: <br/> <input name="Notes" type="text" /> </p> <p> CompanyNotes: <br/> <input name="CompanyNotes" type="text" /> </p> <p> Payment: <br/> <input name="Payment" type="text" value="Leave Blank for 0" /> </p> <p> <input type="submit" Value='Book' onclick="f1.action='insert.php'; return true " /> <!--<div id="wheel"><a href="instructorSearch.php"onClick="return popup(this, 'notes')"><img id="mainLogo" src="im/wheel.png" alt="Driving School Logo" /></a></div> !--> </p> <p><input type="submit" Value='Enquire' onclick="f1.action='insertEnquire.php'; return true " /> </form> The first button on the code works but the pop up only displays for a split second, the hyperlink underneath the button opens the pop up for good but cannot get the variable from the form.... hello, im new to this forum and i hope i put this in the appropiate section on my html file i putt a button and linked it to another html but when open the html i cannot view the button, what could be causing this button to not be seen? thanks I am unable to get my form to look like this:- Somehow my image and the buttons are not together or not well formatted. I am creating a form to fascilitate the order of repeat prescriptions with the abillity to records 10 seperate drugs. However I have recently had a request from a local practise asking if it would possible for the form to exclude all empty fields when submitting the results. Having discussed this with many colleagues and friends within Web Design, I still cannot seem to find the relevant piece of code that would be used for this, my holy grail sorta. Lol. Neway any help on this would be awesome... I'm trying to create a basic form with a text, password and submit button. I don't really have clue on how to set up this form and aswell I need to style it so it fits in my header on a straight line. If anyone could help it would be much appreciated? Thanks Forms are not my strong suite. I am getting an error message that I can't figure out. Here is the error The requested method POST is not allowed for the URL /register.htm. and here is the form code. Code: <form name="individual_registration" action="" method="post"> <table style="width: 500px; margin: 0px auto; text-align: left;"> <tr> <td colspan="2"><h2>PLAYER INFORMATION</h2></td> </tr> <tr> <td style="width: 200px; text-align: right;"><strong>First Name</strong>:</td> <td align="left"><input type="text" id="first_name" name="first_name" /></td> </tr> <tr> <td style="width: 200px; text-align: right;"><strong>Last Name</strong>:</td> <td align="left"><input type="text" id="last_name" name="last_name" /></td> </tr> <tr> <td style="width: 200px; text-align: right;"><strong>City</strong>:</td> <td align="left"><input type="text" id="city" name="city" /></td> </tr> <tr> <td style="width: 200px; text-align: right;"><strong>Zip Code</strong>:</td> <td align="left"><input type="text" id="zip" name="zip" /></td> </tr> <tr> <td style="width: 200px; text-align: right;"><strong>Email</strong>:</td> <td align="left"><input type="text" id="email" name="email" maxlength="50" /></td> </tr> <tr> <td style="width: 200px; text-align: right;"><strong>Home Phone</strong>:</td> <td align="left"><input type="text" id="home_phone" name="home_phone" maxlength="50" /></td> </tr> <tr> <td style="width: 200px; text-align: right;"><strong>Birth Date</strong>:</td> <td align="left"><script>DateInput('birthdate', true, 'YYYY-MM-DD')</script></td> </tr> <tr> <td style="width: 200px; text-align: right;"><strong>Gender</strong>:</td> <td align="left"><select id="gender" name="gender"> <option value="" selected>Choose <option value="F">F <option value="M">M </select></td> </tr> <tr> <td style="width: 200px; text-align: right;"><strong>Grade</strong>:</td> <td align="left"><select id="grade" name="grade"> <option value="" selected>Choose <option value="2">2 <option value="3">3 <option value="4">4 <option value="5">5 <option value="6">6 <option value="7">7 <option value="8">8 </select></td> </tr> <tr> <td style="width: 200px; text-align: right;"><strong>School</strong>:</td> <td align="left"><input type="text" id="school" name="school" /></td> </tr> <tr> <td> </td> </tr> <tr> <td colspan="2"><h2>PARENT / GUARDIAN</h2></td> </tr> <tr> <td style="width: 200px; text-align: right;"><strong>First Name</strong>:</td> <td align="left"><input type="text" id="guardian_first_name" name="guardian_first_name" /></td> </tr> <tr> <td style="width: 200px; text-align: right;"><strong>Last Name</strong>:</td> <td align="left"><input type="text" id="guardian_last_name" name="guardian_last_name" /></td> </tr> <tr> <td style="width: 200px; text-align: right;"><strong>Email</strong>:</td> <td align="left"><input type="text" id="guardian_email" name="guardian_email" maxlength="50" /></td> </tr> <tr> <td style="width: 200px; text-align: right;"><strong>Home Phone</strong>:</td> <td align="left"><input type="text" id="guardian_home_phone" name="guardian_home_phone" maxlength="50" /></td> </tr> <tr> <td style="width: 200px; text-align: right;"><strong>Work Phone</strong>:</td> <td align="left"><input type="text" id="guardian_work_phone" name="guardian_work_phone" maxlength="50" /></td> </tr> <tr> <td style="width: 200px; text-align: right;"><strong>Cell Phone</strong>:</td> <td align="left"><input type="text" id="guardian_cell_phone" name="guardian_cell_phone" maxlength="50" /></td> </tr> <tr> <td> </td> </tr> <tr> <td colspan="2"><h2>MEDICAL / EMERGENCY CONTACT INFORMATION</h2></td> </tr> <tr> <td style="width: 200px; text-align: right;"><strong>Emergency Contact</strong>:</td> <td align="left"><input type="text" id="emergency_contact_name" name="emergency_contact_name" /></td> </tr> <tr> <td style="width: 200px; text-align: right;"><strong>Phone</strong>:</td> <td align="left"><input type="text" id="emergency_contact_phone" name="emergency_contact_phone" /></td> </tr> <tr> <td style="width: 200px; text-align: right;"><strong>Relationship to Runner</strong>:</td> <td align="left"><input type="text" id="emergency_contact_relationship" name="emergency_contact_relationship" /></td> </tr> <tr> <td> </td> </tr> <tr> <td colspan="2"><h2>EVENT INFORMATION</h2></td> </tr> <tr> <td style="width: 200px; text-align: right;"><strong>T-Shirt Size</strong>:</td> <td align="left"> Adult <select id="t_shirt_size" name="t_shirt_size"> <option value="" selected>Choose <option value="S">SMALL <option value="M">MEDIUM <option value="L">LARGE <option value="XL">X-LARGE </select></td> </tr> <tr> <td> </td> </tr> <tr> <td colspan="2"><h2>WAIVER INFORMATION</h2></td> </tr> <tr> <td colspan="2"><p style="text-align: left"> <strong>Middle School Athletic Association</strong> <br> <strong>Middle School State Cross Country</strong> <p> In consideration of being permitted to participate in any way with the Middle School State Cross Country Championship the undersigned: </p> <strong>I understand and have read the above</strong>: <input type="checkbox" id="confirm" name="confirm" value="Y"> Yes </p></td> </tr> <tr> <td> </td> </tr> <tr> <td colspan="2" align="center"><input type="submit" value="Continue" id="submit" name="submit" onClick="return validate(this.form.name)"></td> </tr> </table> </form> Any help I can get is much appreciated. |