I've typed in Example 5-3 as closely as possible, but I got slightly different results from your downloadable example. After poring through your code & mine, I've finally figured out what the problem was, but it was a serious mind-bender for a beginner like me, and I thought I should mention it. In your book, there is a section which is printed like this:
Code:
<div>
<label for='feedback[address]'>Address:</label>
<textarea name='feedback[address]'
cols='40' rows='3' wrap='virtual'>
</textarea>
</div>
<div>
<label for='feedback[message]'>Comments:</label>
<textarea name='feedback[message]'
cols='40' rows='6' wrap='virtual'>
</textarea>
</div>
Well, I typed it in just like this, and I noticed that when I clicked in the comment area, my cursor was indented about an inch from the left. So then I tried this:
Code:
<div>
<label for='feedback[address]'>Address:</label>
<textarea name='feedback[address]' cols='40' rows='3' wrap='virtual'>
</textarea>
</div>
<div>
<label for='feedback[message]'>Comments:</label>
<textarea name='feedback[message]' cols='40' rows='6' wrap='virtual'>
</textarea>
</div>
<div>
No difference. I looked and looked at your downloadable example code, trying to figure out what I was missing. The formatting of the blank space in the code shouldn't matter, right? But yours was different, and it rendered without the extra space in the text field. Your downloadable example looks like this:
Code:
<div>
<label for='feedback[address]'>Address:</label>
<textarea name='feedback[address]' cols='40' rows='3' wrap='virtual'></textarea>
</div>
<div>
<label for='feedback[message]'>Comments:</label>
<textarea name='feedback[message]' cols='40' rows='6' wrap='virtual'></textarea>
</div>
I finally,
finally figured out that the web browser was rendering the indentation before
as a series of 'space' characters inside the text field. You fixed it in your downloadable example, but made no mention of this potential pitfall in your book. I'd suggest making a note of this in the next edition, and correcting your printed example.