troubleshooting Question

if (document.SubmitRegistration.intOption[i1].checked==true)

Avatar of LelloLello
LelloLello asked on
ColdFusion Language
3 Comments1 Solution682 ViewsLast Modified:
What this line do in my code?
if (document.SubmitRegistration.intOption[i1].checked==true)  

Right now i have two option.
Fellows, Affiliates or Correspondents of an actuarial organization or CFA members   100.00*
 
Associates of an actuarial organization   $525*
Please see on that page:
http://209.217.127.200/jp/registration_13_e_.cfm 

If i take out this line 'Associates of an actuarial organization   $525* ' my form calculations will not work... See i took that line (Associates of an actuarial organization   $525*  
) on that page and is not working.
https://209.217.127.200/jp/registration_14_e_.cfm

function Calculate_Sub_Total(me)
		{
			var total=0;
			document.SubmitRegistration.intSubTotal.value=0;
			document.SubmitRegistration.intGST.value=0;	
			document.SubmitRegistration.intTotal.value=0;		
			


			intProv_err = 1;
			taxlable = document.SubmitRegistration.taxlable;
			strProvince = document.SubmitRegistration.strProvince;
			province_array = new Array();
			province_array[0] = new Array("British Columbia","HST", .12, "Add 12% HST");
			province_array[1] = new Array("New Brunswick","HST", .13,"Add 13% HST");
			province_array[2] = new Array("New Foundland and Labrador", "HST", .13, "ADD 13% HST");
			province_array[3] = new Array("Nova Scotia", "HST", 0.15, "ADD 15% HST");
			province_array[4] = new Array("Ontario", "HST", 0.13, "ADD 13% HST");
			province_array[5] = new Array("Alberta", "GST", 0.05, "ADD 5% GST");
			province_array[6] = new Array("Manitoba", "GST", 0.05, "ADD 5% GST");
			province_array[7] = new Array("Prince Edward Island", "GST", 0.05, "ADD 5% GST");
			province_array[8] = new Array("Quebec", "GST", 0.05, "ADD 5% GST");
			province_array[9] = new Array("Saskatchewan", "GST", 0.05, "ADD 5% GST");
			province_array[10] = new Array("North West Territories", "GST", 0.05, "ADD 5% GST");
			province_array[11] = new Array("Yukon", "GST", 0.05, "ADD 5% GST");
			province_array[12] = new Array("Nunavut", "GST", 0.05, "ADD 5% GST");

			
			

			
			//lets do a bit of validation because we need to know the province before we can accuratly calculate
			// the tax on the form.
			
			for(x in province_array) {
				if(province_array[x][0] == strProvince.options[strProvince.selectedIndex].value) intProv_err = 0;
			}
			
			
			
			if(strProvince.options[strProvince.selectedIndex].value == '' || intProv_err  == 1 ) {
				alert("Please complete your address information");
				strProvince.focus();
				if(me.checked)
				{
					me.checked = false;
				} else {
					me.value = '';
				}
				return false;
			} else {

			}
			
	
			
			for (i1=0; i1<6; i1++) 
			{
			

				if (total == 0)
				{
					if (document.SubmitRegistration.intOption[i1].checked==true) 
					{
						//((i1 == 0) || (i1 == 1) || (i1 == 3)) && 
						//if (todaydate <= discountdate) 
						//{
						//	document.SubmitRegistration.intSave.checked = false;
						//}
						//else{
						//	if(i1 == 2 || i1 == 3){
						//		document.SubmitRegistration.intSave.checked = false;															
						//	}else{
							//	document.SubmitRegistration.intSave.checked = true;	
							//}
						//}
						total = document.SubmitRegistration.intOption[i1].value;
					}
				}
			}
			
			//if (document.SubmitRegistration.intSave.checked ==true)
			//{
			//	total = eval(eval(total)+eval(document.SubmitRegistration.intSave.value));
			//}
			
			
			//lets figure out what tax this province is going to use
			/* Modified this morning fltTax = 0.13 */
			
			tax_label = '';
			strProvince_name = strProvince.options[strProvince.selectedIndex].value;
			
			
			for(x in province_array) {
			
				if(province_array[x][0] == strProvince_name) {
					fltTax = parseFloat(province_array[x][2]);
					tax_label = province_array[x][3];
				
				}
			
			}
			
			document.getElementById('taxlabel').innerHTML = tax_label;
			
			document.SubmitRegistration.intSubTotal.value=ToDollarsAndCents(total);
			document.SubmitRegistration.intGST.value= ToDollarsAndCents(eval(total*fltTax));
		 	document.SubmitRegistration.intGSTNumber.value=trimString(document.SubmitRegistration.intGSTNumber.value);
		 	
			if (document.SubmitRegistration.intGSTNumber.value.length == 0) 
			{
				document.SubmitRegistration.intTotal.value=ToDollarsAndCents(eval(eval(document.SubmitRegistration.intSubTotal.value) + eval(document.SubmitRegistration.intGST.value)));
		 	}
			else
			{
				document.SubmitRegistration.intTotal.value=document.SubmitRegistration.intSubTotal.value;	
				document.SubmitRegistration.intGST.value="";		
			}
		
		}
		
		function CheckRadioButton(obj)
		{
			for (i=0; i < obj.length; i++)
			{
				if (obj[i].checked)
					return true;
			}
		   	return false;	
		}
		
		function isInteger(s) 
		{
			for (var i = 0; i < s.length; i++) 
			{
				var c = s.charAt(i);
				if (!((c >= "0") && (c <= "9"))) 
				{
					return false;
				}
			}
			return true;
		}
		
		function trimString (str) 
		{
			str = this != window? this : str;
			return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
		}
		


<table border="0" cellspacing="0" cellpadding="0" width="100%">
					<tr>
						<td width="98%" valign="top"><label for="intOption575">Fellows, Affiliates or Correspondents of an actuarial organization or CFA members</label></td>
						<td width="1%"><cfoutput><cfset intRate = int(val(getRates.rate))>
<input type="radio" name="intOption" id="intOption575" value="#intRate#"  onClick="Calculate_Sub_Total(this)" class="formWidget"></cfoutput></td>
						<td width="5"><img src="images/spacer.gif" height="1" width="5" border="0" alt=""></td>
						<td width="1%" nowrap><label for="intOption575"><cfoutput query="getrates">#getRates.rate#</cfoutput></label><span class="asterisk">*</span></td>
					</tr>
					<!--<tr><td colspan="4"><img src="images/spacer.gif" height="6" width="1" border="0" alt=""></td></tr>
					<tr>
						<td valign="top"><label for="intOption525">Associates of an actuarial organization</label></td>
						<td><input type="radio" name="intOption" id="intOption525" value="525" onClick="Calculate_Sub_Total(this)" class="formWidget"></td>
						<td width="5"><img src="images/spacer.gif" height="1" width="5" border="0" alt=""></td>
						<td nowrap><label for="intOption525">$525</label><span class="asterisk">*</span></td>
					</tr>
					<tr><td colspan="4"><img src="images/spacer.gif" height="6" width="1" border="0" alt=""></td></tr>-->
ASKER CERTIFIED SOLUTION
Sudhindra A N

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros