Solved

Javascript form for conversion

Posted on 2014-01-10
2
289 Views
Last Modified: 2014-01-10
I don't know Javascript so I'm struggling, this will be a 2 second job for someone with a more talent!

I've used the code I found here and made some changes to it here

And it works, the problem is I'd like to change it so

You enter the amount of memory in GB
It then converts the value to bytes (multiply by 1073741824)
It then divides the bytes value by 32 to give the value for Exchange 2010
If then divides the bytes value by 8 to give the value for Exchange 2007

Can someone who knows javascript help me out?

Pete
0
Comment
Question by:Pete Long
2 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
Comment Utility
Test page : http://jsfiddle.net/W8S8S/

    <form>
        <input type="number" id="giga" onchange="conv(this);" onkeyup="conv(this);"  onblur="conv(this);"  onpaste="conv(this);" />
        <input type="number" id="ex10" />
        <input type="number" id="ex07" />
    </form>

Open in new window


function conv(GB){
    var bytes = GB.value * Math.pow(1024,3);
    document.getElementById("ex10").value = bytes / 32;
    document.getElementById("ex07").value = bytes / 8;
}

Open in new window

0
 
LVL 57

Author Comment

by:Pete Long
Comment Utility
Wow, that is perfect! Thanks

Kudos
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now