# JQuery :: Expenditure Calculator - Using Radio Buttons To Multiply Form Field Values

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
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.

## Multiply The Values From The Two Radio Buttons?

Oct 31, 2011

I keep getting 28 when I am suppose to get 22 because of Order of Operations.

<html>
<title>Movie</title>[code]............

## Option Calculator Form With Radio Buttons And Checkboxes

Aug 23, 2010

I am trying to make an option calculator for my site. The user will click on various radio buttons and checkboxes, before pressing the calculate button. The button will then add up all the values to show the overall figure. The code shown below is what I have so far.

Code:
function calcMe(){
for (var i=0; i < document.form.radio.length; i++){

The first javascript is to show the value of the radio button with the textfield attached - when the user puts a number in the textfield, it will update the value of the radio button. The second javascript is to check the document for the clicked radio buttons and checkboxes. It then adds up all the clicked values to show the answer. The problem that I am having is to put these two javascripts together so as the radio button is updated with the text field value as well as adding up all the clicked values.

## JQuery :: Selecting The Values Of Radio Buttons?

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.

## Radio Buttons And Their Values

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....

## 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">
<tr>[code]............

## Sum Values Of Radio Buttons By Matching Input Id?

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:
{

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>

## Change Field Value When Select Radio Buttons?

Aug 24, 2009

I want to change the value of hidden input field when radio buttons selected :

HTML Code:

For example when user click on one the buttons the value of hidden field change to that value.

## JQuery :: Three Radio Buttons With Same Name In Form?

Jan 20, 2011

I have 3 radio buttons with the same name ("myradio"). The value of each is a different URL (e.g. value="[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. Is there any way of doing this using Jquery?

Apr 21, 2011

[Code]...

## Using Visible/hidden Radio Buttons - Create Questionnaire Style Series Of Radio Buttons

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?

## JQuery :: Multiply Values From A Cell ?

Sep 29, 2010

My problem is that I have a table where I show products and costs, then when I entry the amount other cell be updated with the overall

For example:

The amount is entried for the user, it's a textfield

For example I have this code, but doesn't work good

## Autofill 1 Field In An HTML Form With A Result From A Calculator?

Jun 8, 2011

I have a simple calculator on my website which has a few options selectable by radio buttons. When the user adds selections - the total price of their order is automatically calculated and displayed in a <div> for them to see. The client then can deselect options or add according to their budget. The code which deals with this is as follows (just sections of it but you get the point ....) In the <HEAD>

<script type = "text/javascript">
var allprices = [];
var index = 0;

[code]....

## JQuery :: Using Radio Buttons In Form To Search Different URLs?

Nov 29, 2011

I have a form with a search field that I want to search two different databases depending on which radio button is selected. Below is the form I have for searching our library's online catalog. What I'd like to do is add a radio button to this form which would enable the same search box to search WorldCat, which has a different URL

[Code]...

## JQuery :: The Same Id Radio Buttons Doesn't Work On Post Form?

Mar 17, 2011

Here is a script and its uses a latest jquery

\$(function(){
\$(".submit").click(function(){
varname=\$("#name").val();
varsurname=\$("#surname").val();

[Code].....

Its sends only a M value ..The different IDs gives a undefined there is a problem with radio button DOM - Jquery

## Get Radio Button Validation For Different Sets Of Radio Buttons That Simply Contains Yes & No Buttons

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:

## Jquery :: Multiply 2 Input Fields When Either Field Updated

Jun 25, 2009

I pull product price from another page. Then I multiply it with quantity entered in the quantity input field. The problem is, if I forget to enter quantity value before I pull product information or if I change the quantity field later, the final total price is not updated.

My codes:

Code:

UCTID" name="PRODUCTID" /><input type="hidden" class="UNITPRICE" name="UNITPRICE'+(i++)+'" /><small>Search Products</small></div>30"><span class="prices">Unit Price:<span class="UNITPRICE"></span><br />Total Price:<span class="TOTALPRICE"></span><br /><a onclick="RemoveProduct(".column width50");" href="#">Remove</a></span>

[code]...

## JQuery :: Validation Script For A Form With Radio Buttons & Check Box & Text Area

Sep 15, 2010

How do i begin a validation script for a form with radio buttons & check box & text area.

## Div Form Radio Buttons Non-functional In IE

Jul 23, 2005

I am using IE to hide sections of a form. When I display the first
section (name='ea'), the form widgets are not clickable in IE nor do
they accept focus. When I display the 3rd section (name='ec'), the
items in all sections become clickable/accept focus. Has anyone ever
seen anything like this? Code:

## JQuery :: Copy Form Values Select To Radio?

Sep 30, 2011

I am studying jQuery lately and I'm loving it. I already know how to copy form values from input text A to input text B. Here come the part where I am stuck and struggling -- how am I able to copy the selected value from<select> field to <input text="radio"> field?

## Radio Buttons - Creating A Form For A Registration

Jun 1, 2009

I am creating a form for a registration that asks the participant if they have completed pre-requisite training. There are three questions they are asked. When they click yes, the text box for the requested information is enabled, when they click no, they get a warning that they need to register first.

Here is the javascript

The first one works fine (the SERE training question), however, the second one does not function at all. What am I missing to enable the second question to function like the first.

## Form With Radio Buttons To Hide Fields?

Feb 12, 2011

I have a form which has two radio buttons at the beginning which show and hide fields depending on what button is clicked:

I want to adapt this js and html code so that when the page loads it checks whether one of the two radio buttons is clicked and depending on that it displays/hides the divs which are declared in the current function, at the moment it performs this when the user clicks one of the radio buttons but I want to perform it when the page is loaded and also when the user first enters the page I want the yes radio button to be selected and obviously show/hide

[Code]...

Mar 27, 2009

I am trying to adapt code that lets users select a search enginrom radio buttons and use it to search internet.It works fine with check boxes, but I would like RADIO BUTTONSbut cannot because they all need the same name to functionin a set. I have no real knowledge of javascript and would really Code Below

<script language="javascript">
<!--
function netsearch(formname)

[code].....

## Multiply Values From Checkbox Selections

Jun 17, 2011

I am in the process of developing a calculator for some of my colleagues to use. One of the variables within the calculations is called PMH. I want to determine the value of PMH based on which checkboxes are ticked. Each checkbox has a different value. If the checkbox is not ticked, then the value of each option is 1 and obviously more than one checkbox may be ticked.

I have created the checbox code:
<td><input type="checkbox" name="PMH" value="1.6" /> Smoker<br />
<input type="checkbox" name="PMH" value="0.4" /> CCF<br />
<input type="checkbox" name="PMH" value="0.5" /> Pulmonary Oedema / Cirrhosis<br />
<input type="checkbox" name="PMH" value="0.8" /> COAD<br /></td>
But I have no idea on how to calculate what I need for var PMH.

## Comma Separated Values - Form That Gets Values That A User Has Selected From A List Menu Field

Jul 6, 2009

I have a form that gets values that a user has selected from a list menu field, that end up like this added to the URL:[url]

Instead of the Field being mentioned more than once, how can I have it where it could mention the field once with the values coma separated eg:[url]

Would I use JS to change the URL? or VBscript?