Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

To Darkman - can you lend assistance?

Status
Not open for further replies.

programmher

Programmer
May 25, 2000
235
US
Darkman,<br><br>Would you mind taking a look at my code and suggesting the correct CF form reference?&nbsp;&nbsp;The problem is with my VB script when I try to display the result of the Amount Sum...<br><br><br><br><br><br><br><br>&lt;html&gt;<br>&lt;head&gt;<br> &lt;title&gt; Input&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;td style=&quot;color: Navy;&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&lt;td style=&quot;color: Navy;&quot;&gt;&lt;/td&gt; <br> &lt;/tr&gt;<br>&lt;/table&gt;<br>&lt;/head&gt;<br><br>&lt;cfform action=&quot;Input_Post.cfm&quot; method=&quot;POST&quot;&gt;<br>&lt;input type=&quot;hidden&quot; name=&quot;ID&quot; value=&quot;#ID#&quot;&gt;<br><br>&lt;table width=&quot;100%&quot; cellspacing=&quot;2&quot; cellpadding=&quot;2&quot; border=&quot;2&quot;&gt;<br>&lt;tr&gt;<br><br>&nbsp;&lt;th&gt;Last Name:&lt;/th&gt;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput Type = &quot;text&quot;<br> name = &quot;LastName&quot;<br> maxlength=&quot;15&quot; required=&quot;yes&quot; message=&quot;Last Name is a required field!&quot;<br> Size = &quot;15&quot;&gt;&lt;/font&gt;&lt;/td&gt;<br> <br> &lt;th&gt;First Name:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput Type = &quot;text&quot;<br> name = &quot;FirstName&quot;<br> maxlength=&quot;15&quot; required=&quot;yes&quot; message=&quot;First Name is a required field!&quot;<br> Size = &quot;15&quot;&gt;&lt;/font&gt;&lt;/td&gt;<br>&lt;/tr&gt;<br>&lt;tr&gt; <br>&nbsp;&nbsp;&lt;th&gt;MI:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;Font size=-5&gt;&lt;cfinput Type = &quot;text&quot;<br> name =&quot;MI&quot;<br> maxlength=&quot;1&quot; required=&quot;no&quot; <br> Size = &quot;1&quot;&gt;&lt;/font&gt;&lt;/td&gt; <br> <br> &lt;th&gt;SSN:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput type=&quot;Text&quot; name=&quot;SSN&quot; message=&quot;SSN is a required field!&quot; validate=&quot;social_security_number&quot; required=&quot;Yes&quot; size=&quot;9&quot; maxlength=&quot;11&quot;&gt;&lt;Font size=-5&gt;(ex: 123-45-6789)&lt;/font&gt;&lt;/td&gt;<br>&lt;/tr&gt;<br>&lt;tr&gt; <br> <br> &nbsp;&nbsp;&lt;th&gt;Home Address:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput type = &quot;text&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;name = &quot;HomeAddress&quot;<br> maxlength=&quot;30&quot; required=&quot;yes&quot; message=&quot;Home Address is a required field!&quot;&gt;&lt;/td&gt;<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;City:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput Type = &quot;Text&quot;<br> name = &quot;City&quot;<br> maxlength=&quot;20&quot; required=&quot;yes&quot; message=&quot;City is a required field!&quot;<br> Size = &quot;20&quot;&gt;&lt;/td&gt;<br> <br><br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;State:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput Type = &quot;text&quot;<br> name = &quot;St&quot;<br> maxlength=&quot;2&quot; required=&quot;yes&quot; message=&quot;State is a required field!&quot;<br> Size = &quot;2&quot;&gt;&lt;/td&gt;<br>&nbsp;&lt;/tr&gt;<br><br>&lt;tr&gt; <br> <br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;ZIP:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput Type = &quot;text&quot;<br> name = &quot;ZipCode&quot;<br> maxlength=&quot;10&quot; required=&quot;yes&quot; message=&quot; Zip Code is a required field!&quot;<br> Size = &quot;10&quot;&gt;&lt;/td&gt;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;Date:&lt;/th&gt;<br> &lt;td&gt;&lt;cfinput type=&quot;Text&quot; name=&quot;Date&quot; value=&quot;#DateFormat (Now())#&quot; required=&quot;No&quot; size=&quot;9&quot; maxlength=&quot;9&quot; dd=&quot;YES&quot; messate=&quot;DATE is a required field!&quot;&gt;&lt;/td&gt;<br><br><br>&lt;tr&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;Expense:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput type = &quot;text&quot;<br> name = &quot;Expense1&quot;<br> maxlength=&quot;8&quot; required=&quot;yes&quot; message=&quot;This is a required field!&quot;<br> Size = &quot;8&quot;&gt;&lt;/td&gt;<br> <br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;Amount Due:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput type = &quot;text&quot;<br> name = &quot;AmountDue1&quot;<br> maxlength=&quot;8&quot; required=&quot;yes&quot; message=&quot;This is a required field!&quot;<br> Size = &quot;8&quot;&gt;&lt;/td&gt;<br>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;Expense:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput type = &quot;text&quot;<br> name = &quot;Expense2&quot;<br> maxlength=&quot;8&quot; required=&quot;no&quot; message=&quot;This is a required field!&quot;<br> Size = &quot;8&quot;&gt;&lt;/td&gt;<br> <br>&nbsp;&lt;/tr&gt;<br><br>&lt;tr&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;Amount Due:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput type = &quot;text&quot;<br> name = &quot;AmountDue2&quot;<br> maxlength=&quot;8&quot; required=&quot;no&quot; message=&quot;This is a required field!&quot;<br> Size = &quot;8&quot;&gt;&lt;/td&gt;<br> <br><br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;Expense:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput type = &quot;text&quot;<br> name = &quot;Expense3&quot;<br> maxlength=&quot;8&quot; required=&quot;no&quot; message=&quot;This is a required field!&quot;<br> Size = &quot;8&quot;&gt;&lt;/td&gt;<br>&nbsp; <br><br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;Amount Due:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput type = &quot;text&quot;<br> name = &quot;AmountDue3&quot;<br> maxlength=&quot;8&quot; required=&quot;no&quot; message=&quot;This is a required field!&quot;<br> Size = &quot;8&quot;&gt;&lt;/td&gt;<br>&nbsp;&lt;/tr&gt;<br><br>&lt;tr&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;Expense:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput type = &quot;text&quot;<br> name = &quot;Expense4&quot;<br> maxlength=&quot;8&quot; required=&quot;no&quot; <br> DollarFormat<br> message=&quot;The amount due is a required field&quot;<br> Size = &quot;8&quot;&gt;&lt;/td&gt;<br>&nbsp;<br><br>&nbsp;&nbsp;&lt;th&gt;Amount Due:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput type = &quot;text&quot;<br> name = &quot;AmountDue4&quot;<br> maxlength=&quot;8&quot; required=&quot;no&quot; <br> DollarFormat<br> message=&quot;The amount due is a required field&quot;<br> Size = &quot;8&quot;&gt;&lt;/td&gt;<br><br>&nbsp;&nbsp;&lt;th&gt;Expense:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput type = &quot;text&quot;<br> name = &quot;Expense5&quot;<br> maxlength=&quot;8&quot; required=&quot;no&quot; <br> DollarFormat<br> message=&quot;The amount due is a required field&quot;<br> Size = &quot;8&quot;&gt;&lt;/td&gt;<br>&nbsp;&lt;/tr&gt;<br><br>&lt;tr&gt; <br>&nbsp;&nbsp;&lt;th&gt;Amount Due:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput type = &quot;text&quot;<br> name = &quot;AmountDue5&quot;<br> maxlength=&quot;8&quot; required=&quot;no&quot; <br> DollarFormat<br> message=&quot;The amount due is a required field&quot;<br> Size = &quot;8&quot;&gt;&lt;/td&gt;<br><br>&nbsp;&nbsp;&lt;th&gt;Expense:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput type = &quot;text&quot;<br> name = &quot;Expense6&quot;<br> maxlength=&quot;8&quot; required=&quot;no&quot; <br> DollarFormat<br> message=&quot;The amount due is a required field&quot;<br> Size = &quot;8&quot;&gt;&lt;/td&gt;<br><br>&nbsp;&nbsp;&lt;th&gt;Amount Due:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput type = &quot;text&quot;<br> name = &quot;AmountDue6&quot;<br> maxlength=&quot;8&quot; required=&quot;no&quot; <br> DollarFormat<br> message=&quot;The amount due is a required field&quot;<br> Size = &quot;8&quot;&gt;&lt;/td&gt;<br>&nbsp;&lt;/tr&gt;<br><br>&lt;tr&gt; <br> &lt;th&gt;Amount Sum:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput type=&quot;Text&quot; name=&quot;AmountSum&quot; message=&quot;This will be a calculated field!&quot; required=&quot;No&quot; size=&quot;8&quot; maxlength=&quot;8&quot; dollarformat=&quot;&quot;&gt;<br>&lt;!--- &lt;cfform action=&quot;Calculate.cfm&quot; method=&quot;POST&quot;&gt; ---&gt;<br>&lt;!--- &lt;br&gt;&lt;input type=&quot;submit&quot; name=&quot;Calculate&quot; value=&quot;Calculate&quot;&gt; &lt;/cfform&gt;---&gt;<br>&lt;/td&gt;<br>&lt;!--- <br> &lt;cfinput type=&quot;Text&quot; name=&quot;AmountSum&quot; message=&quot;This will be a calculated field!&quot; required=&quot;No&quot; size=&quot;8&quot; maxlength=&quot;8&quot; dollarformat=&quot;&quot;&gt; ---&gt;<br><br>&nbsp;&nbsp;&nbsp;&lt;th&gt;Remarks:&lt;/th&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;Input Type=&quot;textarea&quot;<br> name = &quot;Remarks&quot;<br> cols = &quot;37&quot;<br> rows = &quot;4&quot;<br> maxlength=&quot;50&quot; <br> wrap = &quot;Virtual&quot;&gt;&lt;/textarea&gt;&lt;/td&gt;<br> <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th align=&quot;CENTER&quot; valign=&quot;MIDDLE&quot;&gt;Applicant Name:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td align=&quot;CENTER&quot; valign=&quot;MIDDLE&quot;&gt;&lt;cfinput type = &quot;text&quot;<br> name = &quot;ApplicantName&quot;<br> maxlength=&quot;25&quot; required=&quot;yes&quot; message=&quot;Please enter the Applicant's name!&quot;<br> Size = &quot;25&quot;&gt;&lt;/td&gt;<br><br>&lt;/table&gt;<br>&lt;Input type=&quot;button&quot; name=&quot;cmdCalculate&quot; value=&quot;Calculate&quot;&gt;<br><br>&lt;script language=&quot;VBScript&quot;&gt;<br><br>Option Explicit<br><br>Sub Main (cmdCalculate_OnClick)<br> Dim AmountDue1<br> Dim AmountDue2<br> Dim AmountDue3<br> Dim AmountDue4<br> Dim AmountDue5<br> Dim AmountDue6<br> Dim AmountSum<br> <br>AmountSum = Input_Two.AmountDue1.value + Input_Two.AmountDue2.value<br><br>Message = &quot;Your&nbsp;&nbsp;total submitted expenses: &quot;<br>Message = Message & &quot;AmountSum:&quot; & tabspace & &quot;$&quot; & Subtotal<br><br>End Sub<br><br>&lt;/script&gt;<br><br><br>&lt;p align=&quot;center&quot;&gt;<br> &lt;Input type = &quot;submit&quot; VALUE=&quot;Submit&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;Input type = &quot;reset&quot; VALUE=&quot;Clear Form&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td align=&quot;middle&quot;&gt;<br> &lt;A href=&quot;Home.cfm&quot;target=_self&gt;Home&lt;/A&gt;&lt;/td&gt;<br>&lt;/p&gt;<br>&lt;/cfform&gt;<br>&lt;IMG alt=&quot;&quot; border=0 height=39 src=&quot;../../logo.gif&quot; width=127&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;<br><br><br><br><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top