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
Solved

Javascript form for conversion

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

792 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