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 July 25th, 2011, 03:08 PM
Authorized User
 
Join Date: Aug 2010
Posts: 50
Thanks: 7
Thanked 0 Times in 0 Posts
Default Chapter 11 Try It Out pg 386

Hi When I render the code from the Try it out My Submit Button is a long purple bar with no text on the form and the skins chooser size is know a long drop down box.

The code I am using is listed below.
Code:
<style type="text/css">
    .style1
    {
        width: 100%;
    }
    .Watermark
    {
        font-style: italic;
        color: Gray;
    }
</style>
...

Code:
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
  <ProgressTemplate>
    <div class="PleaseWait">Please Wait... </div>
  </ProgressTemplate>
</asp:UpdateProgress>
<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', function()
                            {
                                this.value ='', this.className = ''
                            }) .addClass('Watermark').css('width', '300px');
      });
</script>
 
Old July 25th, 2011, 03:47 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 there,

Take a look at your first line of jQuery code:

Code:
$(':input(type=text), textarea').each
You have used parenthesis instead of square brackets:

Code:
$(':input[type=text], textarea').each
These are not recognized by jQuery leading to apparently unpredictable results ;-)

Hope this helps,

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:
hozdaman (July 25th, 2011)
 
Old July 25th, 2011, 03:52 PM
Authorized User
 
Join Date: Aug 2010
Posts: 50
Thanks: 7
Thanked 0 Times in 0 Posts
Default

Thank you so much, I was trying figure this out for the last 2 hours.

Thanks!!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 11 - Try it Out Pg. 370 ISE1988 BOOK: Beginning ASP.NET 4 : in C# and VB 4 October 11th, 2010 03:12 PM
Chapter 11 semantic error pg 295 notig BOOK: Beginning Visual C# 2010 0 September 28th, 2010 01:29 PM
Chapter 11 page 386,387 tariq BOOK: Beginning ASP.NET 4 : in C# and VB 2 August 30th, 2010 04:19 PM
Chapter 11 Pg 334 Running Balance JackalBW BOOK: Access 2003 VBA Programmer's Reference 0 November 29th, 2007 04:07 AM





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