Calculating A Person's Age?

Dec 1, 2010

I am trying to write a script that will take a date of birth and another date and, if the person was over 75 years old on the createdDate, return "true" (otherwise return "false").

Unfortunately my code doesn't seem to return either 'true' or 'false'!

The code is:

var dateofBirth="30/10/1982";
var createdDate="01/12/2010";
var sd = dateofBirth.split('/');
var dob = new Date(sd[2],sd[1],sd[0]);

[Code]....

View 2 Replies


ADVERTISEMENT

Get A Person's Name From Facebook?

Mar 22, 2010

The title of every facebook profile page is the person's name. Is there a way to display the title?

I want something like:

var personName = SOME.UNKNOWN.CODE
var greeting = "Hello " + personName
document.write(greeting)

View 7 Replies View Related

Get The MAC Address Of The Person Accessing Website?

Sep 19, 2011

Is there a way to get the MAC address of the person accessing my website? I would like to create a part of my website that only my phone can access.

View 14 Replies View Related

Getting Id - Make Another Div With All The Details - Pictures From The Person

May 19, 2010

I have an array "personen" I first show in an list in "divLijstDerPersonen" and eliminated the Duplicates. When I click on a name in that list I get a column from all the "personen" with that name. function link_Click() Now I want to make another div with all the details, pictures etc from the person I select in that colomn. function iets_click() but for some reason I'm not able to get the document.getElementById("autoid" + i);

[Code]...

View 2 Replies View Related

Create A Slideshow Where A Person Clicks On A Link?

Feb 10, 2011

I have created a slideshow before but I want to create a slideshow where a person clicks on a link and it goes to a certain picture which might have one or more links embedded into the picture something like this:

[URL]

View 5 Replies View Related

Program That Calculates And Displays A Person's Body Mass Index - BMI

Feb 22, 2010

Write a program that calculates and displays a person's body mass index (BMI). The BMI is often used to determine whether a person with a sedentary lifestyle is overweight or under-weight for his or her height. A person's BMI is calculated with the following forula: BMI = weight x 703 / height^2

Where weight is measured in pounds and height is measured in inches. The program should display a message indicating whether the person has optimal weight, is underweight, or is overweight. A sedentary person's weight is considered optimal if his or her BMI is between 18.5 and 25. If the BMI is less than 18.5, the person is considered underweight. If the BMI value is greater than 25, the person is considered overweight.

View 2 Replies View Related

Automatically Populate Things Into The Respective Fields - Read The First Line In The Textbox And Load It Into Contact Person Field

Jun 9, 2009

1)i need to create a form with few fields like phoneno,website,address etc and one text area.
2) i copy n paste the details in the textarea n when i click d button. it should automatically populate things into the respective fields.

here s my logic wt i taught of:

1)read the first line in the textbox and load it into contact person field.
2)find the @ symbol and put it into the respective field and if there are more than 1 mail id load it into the same feild using commas.
3)if the phone no is 10 digits then load it into the mobile field else load the rest it into phone field.
4)find for words like road,street,block,stage,floor etc,if present then load it into the address field till the last comma is encountered.
5)the last digits in the address should be loaded into the pincode field.
6)the last word present in the address after the last comma and before the hyphen should be loaded into the city field.
7)find for www or http and load it into the website field,if not found leave it blank.

View 2 Replies View Related

NCAA Tournament Bracket Script - Allow The Person Filling Out The Bracket To Click On Their Predicted Winner For Each Game

Mar 3, 2009

I have created a html ncaa tournament bracket for my website in which I hold annual competitions. Recently, my competition has grown and I need a better way for users to submit their brackets. What Im looking for is a way to allow the person filling out the bracket to click on their predicted winner for each game, which will then fill out the bracket as they move through the bracket until the have predicted a national c

View 90 Replies View Related

If A Person Selects A Friday Class But Not A Saturday Class The Total Cost Field Will Automatically Enter $99?

Sep 27, 2011

CONDITIONS:If a person selects a Friday Class but not a Saturday Class the Total Cost Field will automatically enter $99.If a person selects a Saturday Class but not a Friday Class the Total Cost Field will automatically enter $99 as well.If a person selects both a Friday & Saturday Class the Total Cost field will automatically be $159.I found the following code and so far only have it changing when a Friday class is entered. I have no idea where to go from here

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

[code].....

View 10 Replies View Related

Code A Feature For Website Using DHTML Where The Person Viewing The Website?

Dec 29, 2005

I'm trying to code a feature for my website using DHTML where the person viewing the website can rotate between viewing the positive/negative points of the website being reviewed. This example was in the publication called Using HTML 4 by Lee Anne Phillips. Code:

View 5 Replies View Related

Adding Up, Calculating Value?

Mar 1, 2010

i have a table, with 2 numeric values at the minute, if the checkbox is selected I want the total price to be shown? this is the form I have with the numeric values

<form id="calculation" action="#" method="post">
100 <input type="checkbox" name="check1" value="100" onClick='total_cost()'/>
120 <input type="checkbox" name="check2" value="200" onClick='total_cost()'/>[code].....

View 5 Replies View Related

Calculating Client IP Address

Jul 23, 2005

I want to create a link that a user can click which will create a popup
telling the user their ip address. I have:

var ip = new java.net.InetAddress.getLocalHost().toString();
alert("Your IP address is: " + ip.substring(ip.indexOf("/")+1))

but this does not seem to work. It says the ip is 127.0.0.1. Strangely,
this piece of code used to work but all of a sudden it doesn't for some
unknown reason. Can anyone tell me what's wrong with the above code?

View 3 Replies View Related

Calculating Difference Between Two Dates Using JS

Nov 10, 2006

I have two date fields (check in, check out) and "number of days"
field.

I want the script to calculate automatically the difference.
For example: I have defaults dates, and I want the script to put the
difference in "number of days" field. And if the user will change the
date, the number of days will change automatically.

View 1 Replies View Related

Calculating Age From Date Of Birth?

Jul 11, 2009

I am using date of birth field in my application and i m taking date of birth in yyyy-mm-dd format.

I need to calculate age by using this date of birth and should show alert if age is less than 5 years.

View 2 Replies View Related

Calculating Shipping With If/else And Function?

Sep 21, 2009

I am having difficulty getting the following assignment to run properly:Many companies charge a shipping and handling charge for purchases. Create a Web page that allows a user to enter a purchase price into a text box and includes a JavaScript function that calculates shipping and handling. Add functionality to the script that adds a minimum shipping and handling charge of $1.50 for any purchase that is less than or equal to $25.00.For any orders over $25.00, add 10% to the total purchase price for shipping and handling,but do not include the $1.50 minmum shipping and handling charge. The formula for calculating a percentage is price * percent / 100. For example, the formula for calculating 10% of a $50.00 purchase price is 50 * 10 / 100, which results in a shipping and handling charge of $5.00. After you determine the total cost of the order (purchase plus shipping and handling), display it in an alert dialog box. Save the document as CalcShipping.html.This is what I have after working on it round and round for 4 hours yesterday:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">[code].....

View 5 Replies View Related

Auto Calculating Form

Mar 22, 2007

I've been googleing for a auto calculating form and found nothing, I just want something .. some form, that can add values from different fields ... and make a sum .. in real time ... meaning that ... if I put X value in field #1 and Y value in field #2, at the bottom or somewhere I should have the X+Y value :P..

View 4 Replies View Related

Calculating Textbox Value For Html?

Mar 6, 2010

calculating textbox value from java script for html

Example: (textbox1value X textbox2value) + (textbox3value + textbox4value)= result

where result value should display in textbox5

View 1 Replies View Related

Calculating Difference Between The Two Numbers?

Jul 2, 2009

the following javascript is not calculating the difference between the two numbers.cant understand y

<script language="JavaScript" type="text/javascript">
function showAmt(){
total = document.total.value;[cod

View 2 Replies View Related

Calculating The Average/mean In An Array ?

Mar 30, 2011

Im trying to calculate the mean/average of numbers in an array.how can i get the length of an array to perform in a simple / maths problem whilst being flexiable to the length of the array?

function sum()
{
var i=0 [code].....

View 2 Replies View Related

Calculating Percentage In A Form?

Mar 23, 2010

I am writing a form and doing a bunch of calculations one of which is a percentage based on the value selected. I am returning a correct result for two of the values but for the other two I am not.The 'discount' value is what I am looking for. It should return as 0 for values of 1 but it is doing the math as though it is multiplying by 1. And again for the value of 6 it should be 10% but is taking the value as 4.6 or something.Code is below I've included all of it (sorry) for better ease of understanding the math that is happening:

HTML Code:

<form id="form1" action="" method="get">
<fieldset>
<p>[code]......

View 3 Replies View Related

Calculating Possible Routes Between Two Points

Oct 18, 2011

I am not a developer so not so familiar with javascript. Suppose I have a map with ten junctions and based on that map. I need to calculate all the possible routes between one junction to another. How do I represent the map in javascript and how do I code the function to calculate all the possible routes?

View 1 Replies View Related

Calculating Amount Of Time?

Nov 15, 2011

I was wondering if it is possible to figure out the amount of time passed from a specific time in history till the present? If so how? I have tried so many different things and I am not getting the right returns.

View 3 Replies View Related

Calculating The Scroll Area?

Jun 19, 2009

I am writing a DHTML application which uses AJAX to show dialogue windows etc.. (all the bells and whistles).When I display a DHTML dialogue in the foreground, I use JS to create a div which is a "layer" in between the foreground and the background which essentially "darkens" the background and disables all background functionality. Forcing the user to take action in the dialogue.How do I get the total scrollable area of the page so I know how big to make the "dark" div?I have tried all of these:

document.body.scrollWidth
document.body.scrollHeight
document.body.offsetWidth

[code]...

They all work in one browser or another, (I am testing in IE, FF and Opera) but none of them give me the correct values for the exact scrollable area of the page.

View 3 Replies View Related

Calculating A Score From A Row Of Drop-down Values

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

JQuery :: Calculating Value Based On Two Sliders?

Oct 14, 2009

I am trying to calculate a value based on two sliders.

This is the code that I am using:

var value1;
var value2;
$(function() {

[Code]....

View 2 Replies View Related

JQuery :: Calculating Height Of DIV Elements

Feb 7, 2011

I have a div that is absolutely positioned and stretch on all sides using top:
10px; left: 10px; bottom: 10px; right: 10px;
When I try to get the height of the div, using $('#id').height(); I get 0 (zero). Is there a problem calculating the height of elements like this one, or am I missing something?

View 5 Replies View Related







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