Reply
JavaScript Calculator Form
Old 02-25-2004, 04:03 PM JavaScript Calculator Form
Junior Talker

Posts: 3
Trades: 0
Does anyone know where I might find a tutorial on how to create a calculator form? All that I need to do is take the values of 2 form fields, perform a simple operation when the calculate button is clicked and output the result. Any tips or direction to resources would be appreciated.
b-bomb is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 02-25-2004, 04:25 PM
DaveMo~'s Avatar
Administrator
Defies A Status

Posts: 10,208
Name: Dave
Location: Scott Depot, West Virginia, USA
Trades: 1
This is not a tutorial, but here is the source code for a simple 5 button calculator at Javascript Source.

Does that help?

Dave
DaveMo~ is offline
Reply With Quote
View Public Profile
 
Old 02-26-2004, 09:11 AM
Wenslock's Avatar
Webmaster Talker

Posts: 746
Location: Lincoln, UK
Trades: 0
easy stuff really there's a similar thing on JSS (http://www.javascriptsource.com).

If you can use PHP, it's really easy to do. I just recently did something like what your on about.

If you know any JS, You shouldn't really have too much problem doing it yourself really though just remember to give yourself 2 text boxes (<INPUT>) and one list menu (+,-,*,\) then make it so that the JS gets the first variable uses the second variable (+,-,*,\) with the last variable. (ie (PHP) $1box $opt $2box)

I've made a few calculators this way (VAT calc, currency converter etc). if you don't mind using PHP, I could make a really quick script...
__________________
------------------------------------------------------------
www.blackprism.co.uk - Black Prism professional web design services
------------------------------------------------------------
Wenslock is offline
Reply With Quote
View Public Profile
 
Old 02-26-2004, 12:41 PM
Junior Talker

Posts: 3
Trades: 0
Hi Wenslock,

That would be great if you would be willing to do that! You can e-mail me at bblock@ualberta.ca. Thanks so much.

I think I will bang away at the JS version just for learning though.

Thanks again.
b-bomb is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to JavaScript Calculator Form
 

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 0.11063 seconds with 13 queries