HTML - How To Do The Simplest Calculation?
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. Similar TutorialsHi, so been learning HTML/CSS for a while now and sometimes when I go on a website I see things which I can figure out how to do, but not sure if the way I would go about it is the correct method today - so my question is if you look at the following website: http://www.park-resorts.com/campaign...gionId=4&var=a You see they have a gradient background like a lot of websites do, is this simply done by creating a background image that is say a few pixels wide but with a height of roughly the browser and the setting it to repeat horizontally? Thanking you. Ashley Hello everyone: I have tried to create a nav bar and have failed, I have three small questions about this: This is the link: www.keepitdecent.com 1. I want to center the image, I know I have not provided the image link but I will when the nav bar is done. 2. I want the links that now are at the center of the table, to be at the bottom of the table making it a real nav bar where the links are at the bottom and the image at the center. 3. How can the table have the height of all the screen? I mean you can see in screen resolution 800 per 600 that the table starts a bit below the start of the page, I would like it to cover the top of the page like any navigation bar does in any page that covers the top of the page and starts at the top of the page and not a bit below. Hope someone can help me with this. Thanks. Al. Okay, I want to get a discussion going here about the whole IE/FF discrepancy thing... While I've been doing web development for about 5 years now, I've been more focussed on the backend and the only frontend design I've worried about has been in order to get users on an intranet access to the data in the backend... Intranets don't need to be "pretty" (although they do need to be accessible, and not ugly)... Anyway, until recently, I didn't really care about the problem... Now I'm working on more public sites, and I want to make sure I use valid code and best practices - but even the simplest piece of HTML has different behaviours in the two main browsers - as can be seen by the attached screenshots... Isn't it time someone sat down and figured out what the correct box model would be and get all the browsers to comply to it? hi 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 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!!!!! 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 |