-
Javascript calculation query...
Hi there folks - I'm trying to code a simple javascript calculation for my
site. Basically my 'function calcCost()' is a pretty straight forward affair.
In the body of the page, I want users to select from one of 3 text choices
that I give (in a radio checkbox selection - where only one can be selected).
Their choice then needs to be converted into a numerical value, for use in
the function. Then, the function will multiply their choice by another number
(entered by the user in another input box) to give an actual result.
My problem is that I that I don't know how to convert the radiobox selection
into a numberical entity, for use in the equation?
I assume that I need to make the 3 choices into an array and give them 'numerical'
values, which, somehow, can then be incorporated into the equation?
I'm getting close - I know, I can feel a familiar rumbling in my tummy, but
can't quite crack it... Anyone got any ideas?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks