Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning 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 30th, 2010, 04:08 PM
Authorized User
 
Join Date: Jun 2010
Posts: 27
Thanks: 8
Thanked 0 Times in 0 Posts
Default Chapter 11 page 386,387

This is the code i added to my ContactForm.ascx control:

Code:
<script type="text/javascript">
    $(function()
    {
     $(':input[type=text], textarea').each
     (
     function()
     {
     var newText = 'Please enter your ' + $(this).parent().prev().text().toLowerCase().trim();
     $(this).attr('value', newText);
     }).one('focus', funciton()
     {
     this.value = '', this.className = ''
     }).addClass('Watermark').css('width', '300px');
        
    });
</script>
exactly what is described in the book.
Compiles fine and shows in the browser no errors at all but i am not able to c any text as Enter you name etc.

Something is obviously wrong somewhere, can someone shed some light on this please.

Thanks in advance.

Best Regards
Tariq
 
Old August 30th, 2010, 04:12 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 Tariq,

Take a look at this:

Code:
 
}).one('focus', funciton()
It's not funciton, but function....

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!
 
Old August 30th, 2010, 04:19 PM
Authorized User
 
Join Date: Jun 2010
Posts: 27
Thanks: 8
Thanked 0 Times in 0 Posts
Default Thanks for Quick reply

That was really quick
Really appriciated Imar.

Thanks again.
will check the spelling mistake first next time.
Tariq





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 1, page 11/12 jonzi_456 BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 7 April 21st, 2010 09:18 PM
Chapter 1, page 11 typo? tumana BOOK Beginning Linux Programming, 3rd Edition 4 August 25th, 2006 10:43 AM





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