rudy.siregar Posted February 8, 2008 Share Posted February 8, 2008 Low Dear, Can u help he here, i have to found the way how to make something calculator like this : http://www.psprint.com/printing_products/8x11_brochure_printing.asp and http://www.printingonline.com.au/OrderA4_booklet.php So, the script can make a value of total changes everytime i click the radio and list/menu till i finish click and they show our total order. Can u help me here? When i download this pages include the .js file, i really confuse where should i start to read this code. Can u give me the simple way to understand the code? And can u make a sample to make it simple? Because i'm doing project which seem like this calculator. Or maybe there are downloadable script that ready to use?? thx for attention. regards, Rudy Quote Link to comment Share on other sites More sharing options...
nogray Posted February 8, 2008 Share Posted February 8, 2008 Here is a small script that will do something similar, you just need to fine tune it. <script language="javascript"> var base_val = 100; var opts = {}; opts.Memory =0; opts.Size = 0; opts.Warranty = 0; function addValues(){ var total = base_val; for (p in opts){ total += opts[p]; } document.getElementById('total').innerHTML = total; } function updateOptions(opt, value){ opts[opt] = value; addValues(); } </script> Memory: <select onchange="if (this.value == '256 MB') updateOptions('Memory', 0); else if (this.value == '512 MB') updateOptions('Memory', 50); else updateOptions('Memory', 100);"> <option value="256 MB">256 MB</option> <option value="512 MB">512 MB</option> <option value="1024 MB">1024 MB</option> </select> <br /> Memory: <select onchange="if (this.value == '50 GB') updateOptions('Size', 0); else if (this.value == '100 GB') updateOptions('Size', 50); else updateOptions('Size', 100);"> <option value="50 GB">50 GB</option> <option value="100 GB">100 GB</option> <option value="150 GB">150 GB</option> </select> <br /> Warranty: <input type="checkbox" onclick="if (this.checked) updateOptions('Warranty', 200); else updateOptions('Warranty', 0);" /> <div id="total" style="font-weight:bold;">100</div> Quote Link to comment Share on other sites More sharing options...
rudy.siregar Posted February 11, 2008 Author Share Posted February 11, 2008 Thats working well, thx so much. I try to tune it. regards, rudy Quote Link to comment Share on other sites More sharing options...
rudy.siregar Posted March 10, 2008 Author Share Posted March 10, 2008 Hello All, I want to add some changes to my source below, and i need one input form which type is text. And the condition is when i fill numeric character in it with range 10-500, can make value changes in total. can u help me find this out? thank you very much. regards rudy Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.