Solved

Javascript form for conversion

Posted on 2014-01-10
2
338 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 39770889
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
ID: 39770989
Wow, that is perfect! Thanks

Kudos
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

695 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