Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-18-2010, 12:00 AM   PM User | #1
optimus203
Regular Coder

 
optimus203's Avatar
 
Join Date: Sep 2008
Location: CT
Posts: 316
Thanks: 22
Thanked 16 Times in 15 Posts
optimus203 is an unknown quantity at this point
Form totals without having to submit form?

Hey everyone. I have a project I'd like to create, but need some help with (Note, I am a newbie with PHP).

I want to create a carbon footprint calculator as part of a school project. The equations will be created using PHP equations and a form for user input values.

I would like to know if (and how) the totals for the users input can be displayed on the screen, without the user having to submit the form. Thanks in advance for your help.
__________________
Always thank those CF Users who help you solve issues...
Connecticut Web Design
optimus203 is offline   Reply With Quote
Old 01-18-2010, 12:11 AM   PM User | #2
Len Whistler
Senior Coder

 
Len Whistler's Avatar
 
Join Date: Jul 2002
Location: Vancouver, BC Canada
Posts: 1,323
Thanks: 26
Thanked 100 Times in 100 Posts
Len Whistler is on a distinguished road
Quote:
Originally Posted by optimus203 View Post
Hey everyone. I have a project I'd like to create, but need some help with (Note, I am a newbie with PHP).

I want to create a carbon footprint calculator as part of a school project. The equations will be created using PHP equations and a form for user input values.

I would like to know if (and how) the totals for the users input can be displayed on the screen, without the user having to submit the form. Thanks in advance for your help.
It would be best to use Javascript to get calculations without reloading the page.

http://www.codingforums.com/forumdisplay.php?f=2


------



-----------
__________________
Leonard Whistler
Len Whistler is offline   Reply With Quote
Old 01-18-2010, 12:44 AM   PM User | #3
optimus203
Regular Coder

 
optimus203's Avatar
 
Join Date: Sep 2008
Location: CT
Posts: 316
Thanks: 22
Thanked 16 Times in 15 Posts
optimus203 is an unknown quantity at this point
Thats what I was thinking. Do you have a link to a particular thread that will help? Looking right now for a solution on the link you provided, but haven't been able to find the right thread yet. Thanks.
__________________
Always thank those CF Users who help you solve issues...
Connecticut Web Design
optimus203 is offline   Reply With Quote
Old 01-18-2010, 12:48 AM   PM User | #4
Len Whistler
Senior Coder

 
Len Whistler's Avatar
 
Join Date: Jul 2002
Location: Vancouver, BC Canada
Posts: 1,323
Thanks: 26
Thanked 100 Times in 100 Posts
Len Whistler is on a distinguished road
Here is an example:

http://www.javascriptkit.com/script/cut18.shtml




----------------
__________________
Leonard Whistler
Len Whistler is offline   Reply With Quote
Old 01-18-2010, 12:56 AM   PM User | #5
optimus203
Regular Coder

 
optimus203's Avatar
 
Join Date: Sep 2008
Location: CT
Posts: 316
Thanks: 22
Thanked 16 Times in 15 Posts
optimus203 is an unknown quantity at this point
I'm trying to find something a little more complex, like this:
http://www.nature.org/initiatives/cl...ge/calculator/
__________________
Always thank those CF Users who help you solve issues...
Connecticut Web Design
optimus203 is offline   Reply With Quote
Old 01-18-2010, 01:42 AM   PM User | #6
JAY6390
Regular Coder

 
Join Date: Dec 2009
Location: UK
Posts: 495
Thanks: 0
Thanked 58 Times in 58 Posts
JAY6390 is on a distinguished road
If you're wanting it to work live, use a javascript calculator like Len has suggested. PHP requires a request to be sent to the server, so the only way that it can be run is to either reload the page with a form submission or send an AJAX request to the server instead, and is a little overkill for your needs since javascript alone can handle this
__________________
My site: JayGilford.com
Resources:
PHP Pagination Class | Getting all page links | Handling PHP Errors properly
If you like a users help, show your appreciation with the rep and thanks buttons :)
JAY6390 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 08:55 AM.


Advertisement
Log in to turn off these ads.