Solved

Javascript form for conversion

Posted on 2014-01-10
2
294 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SharePoint 2013 Blog Template 2 31
Centering Vertically 3 27
CONVERT JAVASCRIPT BUTTON TO HYPERLINK TEXT 6 14
Jquery get each value 2 13
Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

919 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

14 Experts available now in Live!

Get 1:1 Help Now