Wrox Programmer Forums
|
BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4
This is the forum to discuss the Wrox book Beginning Dreamweaver MX by Charles E. Brown, Imar Spaanjaars, Todd Marks; ISBN: 9780764544040
Please indicate which version of the book you are using when posting questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 17th, 2004, 08:57 AM
Authorized User
 
Join Date: Feb 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default calculating and results

Hi Imar
reguading the retrieving the resluts on calculating i still cant see the results, there is the entire code :
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
    Dim dblResult
    Dim dblNumber1
    Dim dblNumber2
    If Request.Form("btnCalculate") <> "" Then
        dblNumber1 = CDbl(Request.Form("txtNumber1"))
        dblNumber2 = CDbl(Request.Form("txtNumber2"))
        Select Case Request.Form("lstOperator")
            Case "+"
                dblResult = dblNumber1 + dblumber2
            Case "-"
                dblResult = dblNumber1 - dblNumber2
            Case "*"
                dblResult = dblNumber1 * dblNumber2
            Case "/"
                dblResult = dblNumber1 / dblNumber2
        End Select
    End If
%>
<html> <form action="calculator.asp" method="post" name="frmCalculator">
            <table border="0" align="left" cellpadding="0" cellspacing="0">
              <tr>
                <td><div align="left">
 <input name="txtNumber1" type="text" value="<%=dblNumber1%>"/></td>
 <td><select name="1stOperator">
                      <option value="+">+</option>
                      <option value="-">-</option>
                      <option value="*">*</option>
                      <option value="/">/</option>
 </select></td>

 <td><input name="txtNumber2" type="text" value="<%=dblNumber2%>"/></td>

  <td><input name="btnCalculate" type="submit" value="Calculate"/> </td>

              </tr>
              <tr>
                <td colspan="4">The Outcome is: <% = dblResult %></td>
              </tr>
            </table>

</form></html>
many thanks


 
Old February 17th, 2004, 09:04 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I think you should get rid of the 1 key on your keyboard :-)
Look at this:

<select name="1stOperator">

It should be lstOperator, with an l for list, not a 1 for one....

Cheers,

Imar



---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating time Marta Access 0 April 15th, 2008 10:34 PM
calculating work_days jonsey SQL Server 2005 1 February 5th, 2008 05:37 PM
Edit Query Results in Results Grid druid2112 SQL Server 2005 1 June 28th, 2007 08:49 AM
Calculating ashik112 ASP.NET 1.0 and 1.1 Basics 2 February 14th, 2007 12:49 PM
calculating values aceconcepts PHP How-To 0 February 16th, 2006 09:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.