Calculator Form - Converting Gauge Value In Gun Barrels

Jul 26, 2011

I have only one variable for input which is diameter of a circle in millimeters. This ultimately converts into a Gauge value as in gun barrels. I can do this in Excel but haven't much of a clue about coding for a web page element.
-So I have input X halved to give a radius.
-Then 4/3 pi r cubed gives the volume in cu mm
-Volume x 0.01134 which is the weight in grams of lead per cubic mm gives the weight of the sphere
-This is then divided into 453.59237 which is the weight of a lb of lead in grams
-Result is number of spheres per lb lead i.e. the gauge
-So if we start with a bore of 23mm (0.906").
-We end with a gauge of 6.278 and a weight of 72.26gms (2.549 oz)

View 9 Replies


ADVERTISEMENT

Gauge Meter - Output Not Working Like Intended In Firefox

May 27, 2010

I am working on a meter which show 3 different result in one single gauge. In IE 8 the output works like intended but not in Mozilla Firefox 3.6.3. the meter shown up but not the needle doesn't move accordingly. Note that while I add in the alert(''); prompt Mozilla only start working on the 3 lines of code below.. Why is it without the alert(''); infront mozilla just didn't work on the "window.document.dpgauge.SetVariable" while putting alert(''); it works?

Code:
<head>
<script type="text/javascript" src="/resources/swf/swfobject.js"></script>
</head>
<body>
<div id="dpgaugeid" ></div>
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("/resources/swf/dpgauge.swf", "dpgauge", "200", "200", "9", "#000000");
so.addVariable("bgimage", "/resources/images/gauge.jpg");
so.addVariable("title", "DP Gauge");
so.addParam("quality", "high");
so.addParam("wmode", "transparent");
so.useExpressInstall('setvar/resources/swf/expressinstall.swf');
so.write("dpgaugeid");
// ]]>
</script>

</body>
<script type='text/javascript'>
function update(){
window.document.dpgauge.SetVariable("dpValue",20)
window.document.dpgauge.SetVariable("dpHist",40)
window.document.dpgauge.SetVariable("dpGreen",60)
}
</script>
<script>
//alert('');
update();
</script>

View 2 Replies View Related

Converting Form Field Data To Uppercase

Jul 20, 2005

Is it possible to convert an item of form field data to uppercase using
the toUpperCase() method? What I'm really asking is, how do I reference the data item?

View 7 Replies View Related

Keep Getting NaN On A Simple Form-based Calculator?

Nov 22, 2010

I keep getting a NaN on this form-based calculator I am trying to make... I can't figure out what I am doing wrong. Any input, or in this case "output", Here is the code:

Code:
<script type="text/javascript">
function calculateBudget()
{

[Code]....

View 1 Replies View Related

Form Calculator - How To Insert New Selection

Nov 10, 2010

I am working on inserting a new selection into a form which uses Javascript to calculate totals. Here is the code for the top of the page:

Code:
<script type="text/javascript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}function KW_getVal(o){ //v1.2 .....

Here is the code contained within the form:
Code:
<tr><td><span class="item_title"Logo Sticker</span> (min. order 100) <img src="images/0_pic.gif" border="0" onclick="MM_openBrWindow('images/orderform/ogo_sticker.gif','','scrollbars=yes,resizable=yes,width=400,height=550')" /> </td>
<td width="178">$4.00<br />per 100</td>
<td ><select name="Logo_Decals_MEMB_A0_006" id="cpa_logo_stickers" onchange="Calc(this.form);">
<option value="0"> </option>
<option value="100">100</option> .....
I know that this is not the proper code, it is copied from another form that uses a different Javascript. What code would I need to insert to make it work here?

I have a sample of working code that is used for an item which costs $1.00 and has no drop down selector:
Code:
<tr>
<td><span class="item_title-blue">Envelope - Individual</span> <img src="images/0_pic.gif" alt="Click to See Picture of Item" border="0" onclick="MM_openBrWindow('images/orderform/env.jpg','','scrollbars=yes,resizable=yes,width=408,height=547')" /></td>
<td align="center" valign="middle">$1.00 </td>
<td align="center" ><p>
<input name="Envelope" type="text" id="FormsEditField224" onchange="KW_calcForm('Envelope Total',100,2,'#Envelope','*','1')" value="" size="4" maxlength="4" />
<label><div align="left">
</label></td><td align="center"><p>
<input id="FormsEditField225" type="text" name="Envelope Total" value="" size="9" maxlength="10" onfocus="this.blur()"/>
</p></td></tr><tr>

The above code does run correctly, I just need it to be for a 4.00 per 100 drop down list as demonstrated before.

View 1 Replies View Related

Form Calculator With Financial Formatted Answer

Apr 14, 2009

I am working on a calculator page for a clients site. I am using dreamweaver and form calculator made by Kaosr as behavior / plugins in dreamweaver. The way I have it set up is first the user enters some numbers in boxes, clicks a get refund now button and a div element appears with the answer. The whole calculator works..but I cant get the answer to appear in currency format. I've found tons of applets for javascript that change it into currency format upon clicking a button or clicking elsewhere on the page.. but none that automatically will make a text box display currency when the answer appears..

View 1 Replies View Related

Form Calculator Coding In Microsoft Excel

Dec 8, 2011

I am trying to create a form/calculator. My concept includes drop down menus, check boxes, roll over images, and calculations. I've been trying to do the coding in Microsoft Excel; however, this has been very cumbersome, and the look is very generic.

View 4 Replies View Related

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

View 18 Replies View Related

Adding Form Calculator To Website - Access Denied

Dec 9, 2011

I want to add this calculator form to our website (here is the link to what he wants exactly [URL]) so I try to copy that code but it won't work. I was wondering if this javascript would work.

Code:
<script language="JavaScript">
function calc() {
gear = document.name1.drpPumpType.1;
vane = document.name1.drpPumpType.2;
if (gear){
txtW = document.form1.txtW.value;
txtD = document.form1.txtD.value;
txtL = document.form1.txtL.value;
int gearCIR;
gearCIR = 6 * txtW *(2 * txtD - txtL) * (txtL - txtD) / 2;
} else {
int vaneCIR;
vaneCIR = 12 * txtW * (txtL + txtD) / 4 * (txtL - txtD) / 2;
}

I probably don't even need a if statement but I haven't program in a long time and never use java script before. Here is the html form code
Code:
<form name="name1">
<table align="center" border="0" width="44%">
<tbody><tr>
<td colspan="3"><span class="BoldHeadingLabel style1">Displacement from Measurements</span></td></tr><tr>
<td width="50"><span class="style1"></span><br /></td>
<td width="157"><span class="BoldLabel style1">Pump/Motor Type:</span></td>
<td width="456"> <span class="style1"></span> <br /></td></tr><tr>
<td width="50"><span class="style1"></span><br /></td>
<td width="157"><span class="BoldLabel style1">Gear Width (W):</span></td>
<td><span class="style1"><input name="txtW" id="txtW" maxlength="10" size="10" value="" type="text" /></span></td></tr><tr>
<td width="50"><span class="style1"></span><br /></td>
<td width="157"><span class="BoldLabel style1">Gear Bore Dia. (D):</span></td>
<td><span class="style1"><input name="txtD" id="txtD" maxlength="10" size="10" value="" type="text" /></span></td></tr><tr>
<td width="50"><span class="style1"></span><br /></td>
<td width="157"><span class="BoldLabel style1">Bore to Bore (L):</span></td>
<td><span class="style1"><input name="txtL" id="txtL" maxlength="10" size="10" value="" type="text" /></span></td></tr><tr>
<td colspan="3"><span class="style1"></span><br /></td></tr><tr>
<td width="50"><span class="style1"></span><br /></td>
<td width="157"><span class="BoldLabel style1">Displacement (CIR) = </span></td>
<td><span class="CalAnswer style1">_________</span><span class="style1"><br />
</span></td></tr><tr></tr><tr>
<td colspan="3"><span class="style1"></span><br />
</td></tr><tr>
<td colspan="3" align="center">
<input value="Calculate" id="submit1" name="submit1" type="submit" />
<input value="Clear" id="clearform" name="clearform" onclick="cmdReset_onclick()" type="button" />
</td></tr></tbody></table></form>

For some reason it says access denied. I copy this code from that website. But can't find any code wrong.

View 1 Replies View Related

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++){
if (document.form.radio[i].checked){
var rad_val = document.form.radio[i].value;
}} if (document.form.radio1.checked) {
document.form.result.value = rad_val;
} if (document.form.radio2.checked) { .....

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.

View 1 Replies View Related

When I Try To Transform It Using IWebkit To Form Using Small Fields, The Calculator Does Not Work?

Oct 25, 2011

I have a HTML/Javascript code which dynamically calculates the entries and gives the grand total.I have it working in table form using textboxes, but when I try to transform it using iWebkit to Form using small fields, the calculator does not work.I want to simply subtract 1 text field from another and user presses a button and gives an answer in a 3rd text field

THIS IS THE GENERIC HTML USING JAVASCRIPT WHICH WORKS FINE....

<html>
<head>
<center>CALCULATOR NOTEPAD++</center>[code]......

View 3 Replies View Related

Form Calculator - Display Number Based Series Of If Else Statements

Sep 22, 2010

I'm just learning javascript and am editing a calculator form that will calculate square footage and write to a form text field. I have another form filed that I would like to display a number based a series of if else statements. ex: if square footage > 2761 then display 5.0., if square footage > 2521 then display 4.5. etc.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<HTML>
<HEAD><TITLE>Size Calculator</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function CalculateSum(Atext, Btext, form){
var A = parseFloat(Atext);
var B = parseFloat(Btext);
form.Footage.value = A * B;
form.Size.value = 21;
}

/* ClearForm: this function has 1 argument: form.
It clears the input and answer fields on the form.
It needs to know the names of the INPUT elements in order to do this. */

function ClearForm(form){
form.input_A.value = "";
form.input_B.value = "";
form.Footage.value = "";
form.Size.value = "";
}
// end of JavaScript functions -->
</SCRIPT></HEAD><BODY>
<P><FONT SIZE="+2">Sizing Calculator</FONT></P>
<FORM NAME="Calculator" METHOD="post">
<P>House width (ft): <INPUT TYPE=TEXT NAME="input_A" SIZE=10></P>
<P>House length (ft): <INPUT TYPE=TEXT NAME="input_B" SIZE=10></P>
<P><INPUT TYPE="button" VALUE="Calculate" name="Calculate" onClick="CalculateSum(this.form.input_A.value, this.form.input_B.value, this.form)"></P>
<P><INPUT TYPE="button" VALUE="Clear Fields" name="ClearButton" onClick="ClearForm(this.form)"></P>
<P>Square footage = <INPUT TYPE=TEXT NAME="Footage" SIZE=12></P>
<P>Size = <INPUT TYPE=TEXT NAME="Size" SIZE=12></P>
</FORM></BODY></HTML>

View 4 Replies View Related

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

Converting ASP To JS?

Sep 9, 2009

Not sure if this should be in the ASP forum or this one (probably could go either), so here goes. I don't know hardly any - probably best to say dont know any at all - javascript. However I have a need to convert some code from asp to js.

the code is checking to see if certain variables are null and if so counting how many of those variables are as such.

the ASP looks like this:
<%
Dim counter
counter = 0

[Code]....

I need to know how to convert this to js so I can show this number to the user without sending data to the server first. I have searched the net for something similar but I am not having much luck finding any examples that do what I would like it to do (maybe this is not something that can/should be done in js?).

View 5 Replies View Related

Converting Gif To An Html ?

Jun 13, 2009

I got a gif image but the file type says = Photoshop.GIFFile.8 and i dont know how to put it in html tag ive tried everything.

Isnt it suppose to be this?

By the way this is the file name(spectrum intro_thumb)

View 4 Replies View Related

Converting A String ...

Feb 7, 2006

I am having some trouble getting an email form to work correctly. I am looking to convert some text from a text area into some basic HTML so I can insert breaks then email it.

So when the user clicks submit ... the string is taken from the textarea and converts the linebreaks into <br> tags.

The problem is not replacing the text, it is finding the line breaks I have no Idea how Code:

View 4 Replies View Related

Converting Data Do Php?

Aug 24, 2010

i'm trying to use a vector that is returned from a javascript datatable to a php session variable.. i've got the following code:

<script type="text/javascript" charset="utf-8">
function fnFormatDetails ( oTable, nTr )
{
var aData = oTable.fnGetData( nTr );

[Code].....

i know that i cant simply convert directly a javascript structure to php.. i just wrote the code in red to explain what i'm trying to do... i need to pass the id from the row in datatable to use on php code on the showcompany.php

View 2 Replies View Related

Converting Bytes Into KB

Jul 21, 2010

Im working using the BEA Aqualogic CMS and have a a few pages with either videos or documents uploaded to them. There is a column displaying the filesize which is using the code below: file size:<pcs:value expr="item.Document.length"></pcs:value> kb The code "<pcs:value expr="item.Document.length"></pcs:value>" is the bit where it pulls the filesize from within the CMS. However, currently this is in bytes and i need this in kb. For arguments you can use 19968 as an integer to convert into bytes.

View 3 Replies View Related

Converting Text To DOM Object

Jul 23, 2005

I have an XML file hosted by my ISP free web space. It naively treats
the file as text/plain. I would like to convert this data into a DOM
object. So far my googling has turned up nothing, although looking over
the DOM manual on Mozilla I came up with:

function convertDOM(text)
{
var lines = text.split("
");
var dom = document.createDocumentFragment();
for (var i = 0; i < lines.length; i++)
{
var node = document.createTextNode(lines[i]);
dom.appendChild(node);
}
return dom;
}

The returned object is not treated as an DOM object.
Anything I am missing / A different approach maybe?

View 2 Replies View Related

Converting A String To An Http One.

Jul 7, 2006

Is there a javascript method or whatever to convert a string to one
that is valid for http transmission?

One that converts characters like " " to %20 || < to &lt: etc

I am after an encompassing javascript line like:-
msg = msg.replace( whatever, http_equivalent );

View 1 Replies View Related

JQuery :: Converting A Php Script?

Nov 23, 2011

I am struggling to get a test to return answers in jquery, I have attched my files in the zip named Turbo. As you can see with the 2 files, the test works fine returning a answer which is in a picture format dependant on how many radio buttons are clicked yes, the results page is wrote with php.

As this is test is to be placed on facebook, facebook does not support php. so I am trying to get the script in javascript or jQuery, Could anyone please assist as I am a begginer at learning the code and have just met dead end after dead end when trying to achieve this.

View 8 Replies View Related

Converting Decimals To Fractions?

Jul 18, 2009

I know this is a rather odd post but I need to be able to convert a decimal to a fraction.Really all i need to know to get what i have to work is being able to tell if a number is whole or not. For instance if i have an accuracy set of .0625 = 1/16"If i take my variable which is set to .5625 (9/16")so if i take variable/accuracy in this case would equal 9. So this way i would know that the numerator would be 9 and my denominator would be 16.If i take the same accuracy of 1/16 and now introduce a variable of 0.5 then it will give me a remainder.

View 5 Replies View Related

Converting CSV To String Variable?

Aug 2, 2011

I have a javascript program that currently takes the contents of a *.txt file and converts it to a string-type variable using a hidden iframe.

For my pruposes it would be much nicer to read a *.csv file instead, however the method I'm using creates the "open/save file" pop-up window.

All files are client-side and in the same folder on one computer; this is NOT server-side or internet-based. It is simply javascript used in an HTA file as programming code. The *.csv does not need to be edited, just read.

I need to know how to convert the text of this *.csv file into a string variable. I have heard of using "xmlHTTPRequest (AJAX)" but am not familiar with how to use this.

View 12 Replies View Related

Converting A Code From VB To Script?

Oct 12, 2011

How can I convert the following code to Javascript:

'SEARCH BY FILE NUMBER IN FILE NUMBER WHEN THE ENTER KEY IS PRESSED
Private Sub h1_KeyDown(ByVal KeyCode As msforms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = vbKeyReturn Then[ccode].....

View 1 Replies View Related

Converting VBScript To JavaScript

Dec 3, 2007

I need some help converting this VBScript over to JavaScript so that the calculations will work properly in browsers other than IE.

You can take a look at Turn 2 Design Code: for a feel about what I'm trying to do, but basicly, I just need to calculate the cost of the selected items based on the selected quantity of that item.

The only thing I know about JavaScript is the small Pop-up scripts I've been able to litterally copy and paste to implement. So, please, dont just post code, post an explaination of whats going on and why so I can try to figure it out. Code:

View 8 Replies View Related

Converting A YYMMDD To DD-MM-YY Format?

Jan 22, 2010

I'm trying to convert a long "string" of numbers given as a YYMMDD format into a DD-MM-YY format.

Code:
850416 would need to become 16-04-85.

I looked into the split() method but as far as I know it doesn't allow to cut off numbers in pairs rather than using a specific delimiter. Is there a way to do this?

Result would be:

Code:
85,04,16

The rest - reversing the array and replacing the "," delimiters with "-" - would be no problem.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved