[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.1

JS Form - Apply State Tax % to Total

Asked by dcayce in JavaScript, Scripting Languages

Hey, Experts.

On the same form as I submitted before, I need now to add a feature that when a customer enters the state tax percentage into a field after the total has been calculated, the total is re-evaluated by that percentage and sent to a Grand Total field.

I'm leaving it up to you to decide whether that entry should be in the form of a decimal or a percent. I can instruct the user either way, so whichever is more logical.

I've created a stripped-down version of the form page for easier access to the critical code areas. The page is: http://www.paulistpress.com/_orderform_stripped.html

I'm also attaching the page code, not knowing if this is inappropriately large... I can only try.

Thanks!

Cayce
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>PP New Order Form</title>
 
 
<link rel="stylesheet" type="text/css" href="http://www.paulistpress.com/css/global.css">
<link href="http://www.paulistpress.com/form_styles.css" rel="stylesheet" type="text/css">
 
 
 
<script Type="text/javascript">
<!--
 
function subTotal(obj, minVal){
    if(isNaN(obj.value)){
       obj.value = '0';
     }
      else if(obj.value!='' && obj.value < minVal){
        alert('Please enter an amount greater than or equal to ' + minVal + ' (minimum value)');
       obj.value = '';
       obj.focus();      
      } 
     else{
       var index = obj.name.split('Item_')[1];
       var val = eval('obj.form.Item_' + index + '_Value');
       var sub = eval('obj.form.Item_' + index + '_Total');
       var mult = (obj.type=='checkbox')?(obj.checked)?obj.value:0:obj.value;
       sub.value = parseFloat(mult * val.value).toFixed(2);
     }
     total(obj.form);
  }
 
function total(objForm){
    var sum = 0;
    for(var i=0; i<objForm.length; i++){
       if(objForm.elements[i].name.indexOf('_Total')>0){
         sum += (objForm.elements[i].value * 1);
       }
     }
     objForm.Item_Total.value = parseFloat(sum).toFixed(2);
  }
//-->
</script>
 
 
</head>
<body bgColor="#550000">
<form name="reg_form" method=post action="" onsubmit="return false;">
 
<table width="612" border="0" ALIGN="center" cellpadding="0" cellspacing="0" bordercolor="0" bgcolor="#FFFFFF">
<TR>
<TD align="center" valign="top">
 
<table width="25%" border="0" align="center" valign="top" cellpadding="0" cellspacing="0" bordercolor="#EEEEEE">
 
<!-- ################# SPACERS ################# -->
<TR ID="shimrow">
<TD align="center" valign="top">
<img src="images/spacer.gif" width="1" height="6"></td>
<TD align="center" valign="top">
<img src="images/spacer.gif" width="45" height="1"></td>
<TD align="center" valign="top">
<img src="images/spacer.gif" width="350" height="1"></td>
<TD align="center" valign="top">
<img src="images/spacer.gif" width="35" height="1"></td>
<TD align="center" valign="top"></td>
<TD align="center" valign="top">
<img src="images/spacer.gif" width="35" height="1"></td>
<TD align="center" valign="top">
<img src="images/spacer.gif" width="30" height="1"></td>
<TD align="center" valign="top">
<img src="images/spacer.gif" width="40" height="1"></td>
</tr>
<!-- ################# SPACERS ################# -->
 
 
<!-- >>>>>>>>>>>> BEGIN PURCHASE ITEM AREA >>>>>>>>>>> -->
<TR>
<TD align="center" valign="top">
<img src="images/spacer.gif" width="1" height="14"></td>
<TD id="sku_1" align="center" valign="top">
<p class="sanSerif fs_10 black cent mT_4 mB_6">
3223-0</p></td>
 
<TD id="title" align="left" valign="top">
<a href="javascript:pop_up('orderForm_pop-ups/120808_0-8091-3223-0.html');" style="text-decoration:none;">
<p class="sanSerif fs_10 blue mT_4 mB_6 mL_10">
How To Be An Adult: A Handbook for Psychological <br>
and Spiritual Integration; David Richo</p></a></td>
 
<TD align="center" valign="middle" id="list_price">
<p class="sanSerif fs_10 med_gray cent mT_4 mB_6 mL_4 mR_6">
9.95</p></td>
<TD align="center" valign="middle"><img src="images/rule_lt_gray.gif" width="1" height="18"></td>
<TD id="disc_price" align="center" valign="middle">
<p class="sanSerif fs_10 black cent mT_4 mB_6">
7.46</p></td>
<TD align="center" valign="middle" id="qty_1">
<input name="Item_3223_0" type="text" class="itemTextField" onblur="subTotal(this);" value="" size="3" maxlength="10"></td>
<input type="hidden" name="Item_3223_0_Value" value="7.46" disabled>
<TD align="center" valign="middle">
<input name="Item_3223_0_Total" onFocus="this.blur()" type="text"  class="itemTextField" value="" size="7" maxlength="10"></td>
</tr>
 
<!-- <<<<<<<<<<<<< END PURCHASE ITEM AREA <<<<<<<<<<<<< -->
 
 
<!-- >>>>>>>>>>>>> BEGIN TOTAL PRICE OF ORDER >>>>>>>>>>>>> -->
<TR id="row_10">
<TD align="right" valign="top">
<img src="images/spacer.gif" width="1" height="14"></td>
<TD align="right" colspan="6">
<p class="sanSerif fs_10 black mT_4 mB_6 mR_6">
Total Price of Order:</p></td>
<TD>
<p class="mT_4 mB_4">
<input name="Item_Total" onFocus="this.blur()" type="text" class="itemTextField" value="" size="7" maxlength="10">
</p></td>
</tr>
<!-- <<<<<<<<<<<<< BEGIN TOTAL PRICE OF ORDER <<<<<<<<<<<<< -->
 
 
<!-- >>>>>>>>>>>>> BEGIN SALES TAX AREA >>>>>>>>>>>>> -->
<TR id="row_10">
<TD align="center" valign="top">
<img src="images/spacer.gif" width="1" height="14"></td>
 
<TD align="right" colspan="6">
<p class="sanSerif fs_10 black mT_4 mB_6 mR_6">
California Residents please enter Sales Tax as percentage:</p></td>
 
<TD>
<p class="mT_4 mB_4">
<input name="Calif_Tax" onFocus="this.blur()" type="text" class="itemTextField" value="" size="7" maxlength="10">
</p></td>
</tr>
<!-- <<<<<<<<<<<<<< END SALES TAX AREA <<<<<<<<<<<<<<< -->
 
 
<!-- ######## BEGIN GRAND TOTAL AREA ######## -->
 
<TR id="row_10">
<TD align="center" valign="top">
<img src="images/spacer.gif" width="1" height="14"></td>
 
<TD align="right" colspan="6">
<p class="sanSerif fs_10 black mT_4 mB_6 mR_6">
Grand Total:</p></td>
&nbsp;
<TD>
<p class="mT_4 mB_4">
<input name="item_Grand_Total" onFocus="this.blur()" type="text" class="itemTextField" value="" size="7" maxlength="10">
</p></td>
</tr>
</table>
</td>
</tr>
 
<TR><TD>&nbsp;</td>
</tr>
 
</table>
 
</form>
 
</body>
</html>
[+][-]12/10/08 12:33 PM, ID: 23142778Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: JavaScript, Scripting Languages
Sign Up Now!
Solution Provided By: hielo
Participating Experts: 2
Solution Grade: A
 
[+][-]12/10/08 11:57 AM, ID: 23142287Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/10/08 12:14 PM, ID: 23142486Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/10/08 12:29 PM, ID: 23142726Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/11/08 04:27 AM, ID: 23147587Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_2_20070628