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 January 17th, 2007, 08:12 AM
Authorized User
 
Join Date: Jan 2007
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Default MX 2004 Chapter 7 - calculator.asp

Imar

Do you have two editions of your MX 2004 book or something. You have an id= in the code for calculator.asp. My book doesn't say to put an id in there.

Although I don't have an id, it still works in IE7. Will it cause problems in other programs?

Terry
 
Old January 17th, 2007, 01:00 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Terry,

There are two different versions of the book, but only the ISBN number is different. The contents are exactly the same.

What page in the book are you referring to?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old January 17th, 2007, 07:00 PM
Authorized User
 
Join Date: Jan 2007
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I can't really tell you what page because I have the book that doesn't mention adding and "id". However, I'm referring to: Try it out - creating a calculator using postback pages 256 - 259. There is no mention to add an id. But the code I downloaded from the site has an id included.

The code I have using your the book:

 <td><input name="txtNumber1" type="text" value="<%=bdlNumber1%>"></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="<%=bdlNumber2%>"></td>
    <td><input name="btnCalculate" type="submit" value="Calculate"></td>
  </tr>

Your code that I downloaded:

<td><input name="txtNumber1" type="text" id="txtNumber1" value="<%=dblNumber1%>"></td>
        <td><select name="lstOperator" id="lstOperator">
                <option value="+">+</option>
                <option value="-">-</option>
                <option value="*">*</option>
                <option value="/">/</option>
              </select>
                </td>
        <td><input name="txtNumber2" type="text" id="txtNumber2" value="<%=dblNumber2%>"></td>
        <td><input name="btnCalculate" type="submit" id="btnCalculate" value="Calculate"></td>
      </tr>
      <tr>

How is it that you have id's in your code and I don't? Either the contents have to be different in to two versions of the book or somehow it was added to the code I downloaded. (Confused here)

Although the code I use, without id's, works in IE7, will it work in other browsers without having id's?

Thanks,
Terry

 
Old January 18th, 2007, 03: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

Hi Terry,

I see now. The id, in this example, isn't necessary. It's mainly used for client side script to refer to an element, as in document.getElementId('txtNumber1'). To submit the value to the server to do the calculation, the name is used instead.

Out of habit, I almost always type both a name and an id, so there's a fair chance I added the id to the code without adding it in the example in the chapter. Don't worry about it too much.

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old January 18th, 2007, 03:42 AM
Authorized User
 
Join Date: Jan 2007
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Excellent, thanks.









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