Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
how to make calculation for some text boxes
Old 01-13-2011, 03:12 AM how to make calculation for some text boxes
Junior Talker

Posts: 3
Trades: 0
hye..im new here..now, im doing my final year project..this is my page code:

HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 

<head> 
<meta content="en-us" http-equiv="Content-Language" /> 
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> 
<title>testing calculation</title> 
<style type="text/css"> 
.style2 { 
text-align: left; 
} 
.style3 { 
font-family: "Bauhaus 93"; 
font-size: xx-large; 
background-color: #C0C0C0; 
} 
</style> 
</head> 

<body style="background-color: #C0C0C0"> 

<div class="style2"> 

CAR CC: 
<input name="carcc" type="text" /><br /> 
SPEED&nbsp;&nbsp; 
: <input name="speed" type="text" /><br /> 
TRAVEL OCCURRENCES&nbsp;&nbsp;&nbsp; : <input name="occurrence" type="text" /><br /> 
PASSENGERS: <input name="passenger" type="text" /><br /> 
DISTANCE: <input name="distance" type="text" /> 
</div> 
<form method="post"> 
<div class="style2"> 
<input name="submit" type="submit" value="CALCULATE RESULT" class="style3" /></div> 
</form> 

</body> 

</html>

..my problem now is i want to make a calculation for all the values in the text boxes and show the result under the CALCULATE RESULT button..my formula for this calculation is like this:
[-20.955 + (0.0013 * carcc) + (0.1463 * speed) + (0.6766 * occurrence) + (0.04 * passenger) + (0.1481 * distance)]
thanks for your help =)

Last edited by chrishirst; 01-16-2011 at 10:55 AM..
kidphantom is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-13-2011, 08:47 AM Re: how to make calculation for some text boxes
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
You can't do it in HTML, you'll need some sort of scripting - javascript or php, etc.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 01-15-2011, 05:22 AM Re: how to make calculation for some text boxes
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
http://www.htmlcodetutorial.com/form..._onSubmit.html and then a bit of basic javascript - see http://www.javascript-coder.com/java...get-form.phtml
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is offline
Reply With Quote
View Public Profile
 
Old 01-15-2011, 10:13 PM Re: how to make calculation for some text boxes
Junior Talker

Posts: 1
Name: Nate
Location: Utah
Trades: 0
I recommend using jQuery for what you're trying to do.

removed

Last edited by chrishirst; 01-16-2011 at 10:56 AM..
ZeroGravityProg is offline
Reply With Quote
View Public Profile Visit ZeroGravityProg's homepage!
 
Old 01-16-2011, 09:33 PM Re: how to make calculation for some text boxes
Marik's Avatar
Skilled Talker

Posts: 99
Trades: 0
No offense but if you think this can be done with a static presentation language like HTML you must not have been paying attention in class.
__________________

Please login or register to view this content. Registration is FREE
Marik is offline
Reply With Quote
View Public Profile
 
Old 02-06-2011, 05:31 PM Re: how to make calculation for some text boxes
Novice Talker

Posts: 12
Name: maichel
Trades: 0
that very easy if you use script language like javascript or php...but that impossible to do it with the css and html.....these 2 languge we use it for do the layout of the site.
__________________

Please login or register to view this content. Registration is FREE
Articles Submission - Submit Your Best Quality Original Articles For Massive Exposure.
grandfaraone is offline
Reply With Quote
View Public Profile Visit grandfaraone's homepage!
 
Old 02-06-2011, 05:36 PM Re: how to make calculation for some text boxes
eyu
eyu's Avatar
Super Talker

Posts: 123
Name: Edward Yu
Trades: 0
btw the only thing inside your <form></form> tags is the submit button.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

eyu is offline
Reply With Quote
View Public Profile Visit eyu's homepage!
 
Old 02-09-2011, 01:43 AM Re: how to make calculation for some text boxes
Banned

Posts: 49
Name: raje
Trades: 0
use php or javascript. To complete task in html is to tough. but easy to do it php
Caitlyn is offline
Reply With Quote
View Public Profile
 
Old 02-09-2011, 01:20 PM Re: how to make calculation for some text boxes
Skilled Talker

Posts: 83
Trades: 0
use any scripting languages (VB or JavaScript) that will solve problem
__________________
»
Please login or register to view this content. Registration is FREE
- Interactive maps for websites
»
Please login or register to view this content. Registration is FREE
for web developers
DmitryS is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to how to make calculation for some text boxes
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.00898 seconds with 12 queries