[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Javascript form for conversion

Posted on 2014-01-10
2
Medium Priority
?
400 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 83

Accepted Solution

by:
leakim971 earned 2000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

867 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