Calculating Values From Radio Buttons?
Mar 15, 2009
I have an assignment in which the person has to choose their department and their hourly wage is given for each department. In the text box they must put their hours worked for the week, which I can't seem to get to work this is what I have:
<form id="employeeGroup">
<table width="398" border="0" align="center" cellpadding="10">
<tr>[code]............
View 4 Replies
ADVERTISEMENT
Jul 23, 2005
I've seen several messages in this group with this question and no reply.
Simply stated, how do you send the status of a group of radio buttons to
a JavaScript function? I have a large project that needs this. Since I
cannot figure it out, I wrote a small page to experiment with it. Here
it is....
View 2 Replies
View Related
Oct 31, 2011
I keep getting 28 when I am suppose to get 22 because of Order of Operations.
<html>
<head>
<title>Movie</title>[code]............
View 15 Replies
View Related
Jul 27, 2009
This is probably simple, but I am new to jQuery and am trying to wrapmy head around things.Basically what I am trying to do is a very basic quiz. I have 3 groupsof radio buttons (3 questions with 4 possible answers for eachquestion, so.. multiple choice).Each answer has a number value assigned to it, i.e. value="2". Thiswould be 2 points.After pressing a button I need to be able to select all the radiobuttons have that been checked, and then add all their point values upand give the user a score.
View 3 Replies
View Related
Apr 19, 2011
User selects radio buttons and the script totals a score based on the selection.Problem: The script returns no value as a total. The script was originally written to total a score by matching input name values beginning with "Set" (i.e., Set1, Set2). At that time the script worked; returning a sum of the selected radio button values. A requirement has mandated changing the names (i.e., EXTFLDV _ 500048). The new name values are not contiguous. I believe this is where the problem may lie.
Script:
function setRadios()
{
function sumRadios()[code]..........
View 2 Replies
View Related
Sep 22, 2011
so basically this is what I have its 2 sets of radio buttons named budget, premier and superior which values are $2,$3 and $5 respectively. a checkbox that if checked the value would make the the first group of radios multiplied by 2 if not it will remain the same the second group would be weekly, monthly and annually which the values will be multiplied to 1,x(52/12) and 52 respectively to everything above. the total would be displayed as an alert message if the none of the first group is selected an alert would be issued when calculate is pressed and that would be please select level of cover and if none of the second group is selected it would display please select frequency of payment but if none is selected at all both alerts would be displayed on a single dialogue box, i cant make a script to make it function properly .i didnt include the script because i suck it doesnt work
<form name="InsuranceCalc">
<p><h2>calutaling insurance</h2></p>
<p> Please complete the form.</p>[code].............
View 8 Replies
View Related
Jul 13, 2010
I'm trying to create a questionnaire style series of radio buttons which are hidden and then a different set of radio buttons displayed depending on the previous answer. eg
Q1 Is it a man? (if select yes then display)
Q2 Is he called John? (if no then display)
Q3 Is he called Gary? and so on...
I've been testing using the code below but wondered if anyone had any ideas on how this could be done easily?
View 2 Replies
View Related
Jun 11, 2011
I am looking to build an expenditure calculator. What I am having problems with is I am using radio buttons to multiply form field values
[radio1] = x 1 (week)
[radio2] = x 4 (month)
[radio3] = x 52 (year)
So if you fill out a field and select [radio2] it multiplies the field by 4. If you then select [radio1] it reverts to the original value. Using JQuery what's the best way to do this. The issue I am having is I need to know the previous selected radio as well as the new one so I know whether to divide or multiply.
View 1 Replies
View Related
Nov 28, 2009
I'm trying to get a radio button validation for different sets of radio buttons that simply contains Yes & No buttons.
Here's what I'm trying to do:
Question 1: if Yes, then (Alert 1) if No, then (Alert 2) (if Yes, then Question 2 appears) *Up to here I'm happy- can't figure out the rest*
Question 2: if Yes, then (Alert 1) if No, then (Alert 2) (if Yes, then Question 3 appears)
I need the Alerts to be swapped from this point*
Question 3: if Yes, then (Alert 2) if No, then (Alert 1) (if NO, then Question 4 appears)
Identical for Question 5, and for Last Question 6 Alerts swapped back again.)
Here's the script that I managed to piece together:
View 5 Replies
View Related
Feb 28, 2010
Im trying to configuere a form that a.a radio buttons that allow the user to choose between quarters, nickels, dimes and pennies and show image when click on my radio button.how to get the image to display whenthey click on the radio button?
View 3 Replies
View Related
Jul 15, 2011
how I can make each radio button call a different page. For example If i click on radio button 1 and click submit it will take me to [url].... and if I click radio button 2 and click submit .
View 7 Replies
View Related
Mar 23, 2009
I have a set of radio buttons each with an onclick event that has a numeric value. When the button is clicked an input box called "Total" is updated with the new value. The problem I'm having is that if a radio button is checked and one clicks on it again then the onclick event is triggered.
Is there any way to prevent the onclick event from triggering if the radio button is already checked?
View 2 Replies
View Related
Jan 20, 2011
I have 3 radio buttons with the same name ("myradio"). The value of each is a different URL (eg. value="http:[url]...)I have a link underneath these (<a href="#">Send</a>). I would like the selected radio button's value to be inserted into the href of the link, and if the user selects a different radio button that this changes.
View 1 Replies
View Related
Oct 21, 2011
I have a form with 4 radio buttons, the scenario is, when a user click on a radio button a hidden content will be displayed and the other three radio buttons will be disabled so that at one time a user can only click and view single radio button and the hidden content.Here is my code to show hide the hidden content but i need when the user select one radio button the other radio buttons should disable.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />[code]......
View 17 Replies
View Related
Aug 11, 2006
I need help in calculating a score from a row of drop-down values.
I need to use the onChange to tally the score as the user moves across
9 categories (with drop-down selection of 1-9 or N/A) multiplied by a
weighted score. The final column for each employee would be the
calculated score. I know how to accomplish this with vbscript but I
need it to process on the screen so the user can see the calculated
score as they make selections. Also the code needs to execute as many
times as there are employee rows.(loop) I don't know how to do this
with Javascript
Here's the VBscript with the variables involved
Var S1 = Category 1 Weighted score
Var S2 = Category 2 Weighted score
Var S3 = Category 3 Weighted score
Var S4 = Category 4 Weighted score
Var S5 = Category 5 Weighted score
Var S6 = Category 6 Weighted score
Var S7 = Category 7 Weighted score
Var S8 = Category 8 Weighted score
Var S9 = Category 9 Weighted score
D5 = 0.92
Var Q11 = Category 1 drop-down Value(1-9) * S1
Var Q22 = Category 2 drop-down Value(1-9) * S2
Var Q33 = Category 3 drop-down Value(1-9) * S3
Var Q44 = Category 4 drop-down Value(1-9) * S4
If (Category 5 Value = "N/A") THEN
Q55 = ' '
Else
Var Q55 = Category 5 drop-down Value(1-9 or N/A) * S5
End If
Var Q66 = Category 6 drop-down Value(1-9) * S6
Var Q77 = Category 7 drop-down Value(1-9) * S7
Var Q88 = Category 8 drop-down Value(1-9) * S8
Var Q99 = Category 9 drop-down Value(1-9) * S9
If (Category 5 = "N/A") THEN
Var FinalScore = round(((Q11 + Q22 + Q33 + Q44 + Q66 + Q77 + Q88 + Q99)
/ D5),2)
else
Var FinalScore = round((Q11 + Q22 + Q33 + Q44 + Q55 + Q66 + Q77 + Q88 +
Q99),2)
end if
Can anyone help me converting this to javascript?
View 1 Replies
View Related
Apr 1, 2009
I have a slight problem with creating dynamic quotes. Basically I have two select boxes and need to calculate a total in real-time using javascript and insert into input.First it needs to explode out the machine price and term years from the values and then calculate.
Here an example: A machine costs �4000 and a term of 2 years(60 months). The calculation would be (4000/60)*3 = �200
<select name="machine">
<option value="2005 - Almida XAS47 (660 Hours) �4000">2005 - Almida XAS47 (660 Hours) �4000</option>
</select>[code].....
View 6 Replies
View Related
Apr 11, 2010
what i need to do to add all the radio botton and check box. i already finish the add formula on the checkbox but i do not know how to add the two selected radio buttons to my checkbox buttons.for example:
O selected is 80
O 60
O 60
O selected is 15
O 15
O 25[code].....
View 5 Replies
View Related
Dec 14, 2007
Well, it's been a while since I last visited CF, but I'm finally back and, for the life of me, am drawing a total blank on something that seems like it should be fairly easy to handle.
The Math.sqrt() function works just fine if all a person needs is the Square Root of a number, but what about needing the Cube Root or even a 4th Root of a number?
My first instinct was to use the Math.pow(x,y) function with a negative value for "y." For instance;
var z=Math.pow(27,-3)
This should return a value of 3. Unfortunately, this doesnt seem to work when I tested it through the W3 reference pages, so I am looking for a clue as to how I might go about finding such values, or if it is even possible through Javascript.
View 2 Replies
View Related
Sep 26, 2010
calculating the summed values of a column. Also, the row values are subtracted from each other eg:
col1 col2 col3
row1 a b = a-b
row2 c d = c-d
row3 =a+c =b+d =a-b+(c-d)
however there can be N number of rows. I have listed below and example I have done to calculate the subtracted values but I am having difficulty doing the summations.
<table width="362" border="1">
<tr>
<td width="91"> <input name='r1c1' onblur='function update_Total_r1c()' size='6' value=""> r1c1</td>
[Code]....
View 2 Replies
View Related
Jun 17, 2011
I want my radio buttons to become submit buttons as well. So when a user clicks on a radio button it submits the action and refreshes the page accordingly. As of now using only using onclick="this.form.submit()" the page only refreshes with no change. Here is a copy of the entire form. It is a custom shipping options form (I did not create it).
<!-- Custom shipping form -->
<form action="" method="post" name="update_shipping">
<table width="300">
<tr>
<td><label>
<input <?php if (!(strcmp($_SESSION['shippingmethod'],"1"))) {echo "checked="checked"";} ?>
[Code]...
View 9 Replies
View Related
Jun 3, 2011
I am trying to use the jquery radio buttons and everything looks well until I press the submit button.What is passed on in my POST variable for the radio buttons is the string "on" and not at all the name of the button. All of the buttons just returns "on".[URL]
View 3 Replies
View Related
Apr 6, 2007
i have a list of 10 radio buttons all with the same ID=R100 i need a javascript to select (checked) say the 4th radio button AFTER the form is created.
View 3 Replies
View Related
Jun 18, 2009
I am trying to set a radio button by a textbox value and also have the radio button be able to set the textbox. So the user can either select a radio button or enter in the text. Is there a simple way to make this happen? Here is what I have so far, which sets the radio button value in the text box. setting the textbox value to the radio button.
<HEAD>
<script>
var number="";
function getRadios(what){
[Code].....
View 3 Replies
View Related
Jul 30, 2010
i'm running a validation script to check if my radio buttons are selected, but i can't seem to get it to read the value of the field.
heres my form
<form name="cases" action="cases_process.php" method="post" onsubmit="return validate(this)">
<input name="uscan" id="uscan" value="n" checked="checked" type="hidden" />
<input type="radio" name="uscan" id="uscan" value="us" class="radial" tabindex="1" /><label>United States</label>
[Code]....
everything works up until the if(uscan == "n") so idk why it cant find what the value of the field is, because ive tested it and it seems to know even know what the value is.
View 15 Replies
View Related
Mar 7, 2011
I have 2 groups of radio buttons..I can manage to make one set be disabled via a selection.. but i can only get this right with the VALUE...Is it possible to use the radio id to do the same?Just use the link below for they jquery
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<html>
<head>
[code]....
View 5 Replies
View Related
Jun 1, 2011
Is it possible to add events using addEventListener to multiple radio buttons with same id ?
<input id="radId" type="radio" value="0" name="radioname">No
<input id="radId" type="radio" value="1" name="radioname">Yes
I tried to attach event using document.getelementByID BUT it always picks the first radio button.
View 3 Replies
View Related