Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1
  1. #1
    rde
    rde is offline
    Junior Member
    Join Date
    Nov 2010
    Posts
    12
    Member #
    24718
    Hello javascript experts!!

    I'm brand new to js and am wondering if I could receive a little guidance from someone who is more knowledgeable than myself. I'd like convert the script below from the select box style to a radio button style. I have an inkling that it isn't that difficult but I'm having no luck. I would be eternally grateful to anyone who could lead me in the right direction.

    Thank you!


    Code:
    <SCRIPT Language="JavaScript"> 
    <!--
    function reCalc() {
     
      newPrice=0.00;
      for(i=0;i<document.TheForm.elements.length;++i)
        if(document.TheForm.elements[i].type == 'select-one') {
    	// if(document.TheForm.elements[i].name == 'Qty') continue;	
    	thisValue = document.TheForm.elements[i].options[document.TheForm.elements[i].selectedIndex].value;
    	if(thisValue.indexOf('|') != -1) newPrice += 1 * thisValue.substring(thisValue.indexOf('=')+1,thisValue.length);
        }
    	
      document.TheForm.Total.value = '$' + Math.round(newPrice*(document.TheForm.Qty.selectedIndex+1)*100)/100;
      if(document.TheForm.Total.value == '$0') document.TheForm.Total.value = '$0.00';
      while(document.TheForm.Total.value.indexOf('.') > document.TheForm.Total.value.length-3) document.TheForm.Total.value += '0';
     
    }
    // -->
    </SCRIPT>

  2.  


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:45 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com