p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional ASP.NET 4 : in C# and VB (http://p2p.wrox.com/forumdisplay.php?f=554)
-   -   Watermark not working (http://p2p.wrox.com/showthread.php?t=84726)

floridaguy August 15th, 2011 09:58 AM

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>

Imar August 15th, 2011 10:10 AM

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

floridaguy August 15th, 2011 10:19 AM

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.


All times are GMT -4. The time now is 05:49 AM.

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