Wrox Programmer Forums
|
BOOK: Professional ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Professional ASP.NET 4 in C# and VB by Bill Evjen, Scott Hanselman, Devin Rader; ISBN: 9780470502204
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 4 : in C# and VB 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 August 15th, 2011, 09:58 AM
Authorized User
 
Join Date: Feb 2011
Posts: 23
Thanks: 7
Thanked 0 Times in 0 Posts
Default Watermark not working

I can't find the code on page 387 in the downloaded samples. Ch 11 Try it out step 3

The water mark won't work for me.

<style type="text/css">
.style1
{
width: 100%;
}
.style2
{
height: 31px;
margin-left: 40px;
}
.Watermark
{
font-style: italic;
color: Gray;
}
</style>

</asp:UpdateProgress>
<script type="text/javascript">
$(function()
{
$(':input[type-text], textarea').each
(
function()
{
var newText = 'Please enter your ' +
$(this).parent().prev().text().toLowerClass().trim ();
$(this).attr('value', newText);
}).one('focus', function()
{
this.value = '', this.className = ''
}).addClass('Watermark').css('width', '300px');
});
</script>
 
Old August 15th, 2011, 10:10 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 there,

The code you posted below comes from my Beginning ASP.NET 4 book while you created this post in the Professional ASP.NET 4 book. But even in the Beginning book's downloadable files you won't find it, as the code is being replaced by a Watermark plugin later in Chapter 11.

That said, take a look at this:

Code:
$(this).parent().prev().text().toLowerClass().trim ();
which should be
Code:
 
$(this).parent().prev().text().toLowerCase().trim();
Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
floridaguy (August 15th, 2011)
 
Old August 15th, 2011, 10:19 AM
Authorized User
 
Join Date: Feb 2011
Posts: 23
Thanks: 7
Thanked 0 Times in 0 Posts
Default

Sorry about posting in the wrong forum. Thanks for the great response. It partially solved the problem. I will move the thread to the correct forum.





Similar Threads
Thread Thread Starter Forum Replies Last Post
jQuery Watermark Plugin Phil Critchley BOOK: Beginning ASP.NET 4 : in C# and VB 11 November 24th, 2011 12:06 PM
Using the Watermark vbboyd BOOK: Beginning ASP.NET 4 : in C# and VB 2 May 26th, 2011 12:17 AM
Chp 7 Caption & Watermark p202 aformoftruth BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 4 March 4th, 2010 06:21 AM
Watermark image amirmunir Crystal Reports 0 June 1st, 2006 12:09 PM
Insert text as watermark in the report? pallavijyo BOOK: Professional Crystal Reports for VS.NET 0 December 15th, 2004 10:14 AM





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