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 February 20th, 2011, 08:03 PM
Authorized User
 
Join Date: Feb 2011
Posts: 37
Thanks: 8
Thanked 0 Times in 0 Posts
Default jQuery Watermark Plugin

Hi

Wondering if anyone has been experimenting with jQuery on completion of the tutorials in Chapter 11? I've been playing about because I want to assign a watermark using the jQuery plugin to a textbox I have in my form as shown below.

The code seems to match the code from the book exercises but when it loads in the browser at runtime the Tooltip text does in fact display but not within the textbox as grey out text but alongside the textbox as normal black text.

Has anyone else experienced a similar problem when using the jQuery plugin?


Code:
<asp:TextBox ID="CriteriaTextBox" runat="server" ToolTip="Please enter the User Name" CssClass="InputBox"></asp:TextBox>
Code:
<script src="../Scripts/jquery.updnWatermark.js" type="text/javascript"></script>

<script type="text/javascript">
    $(function () {
        $.updnWatermark.attachAll({ cssClass: 'Watermark' });
    });
</script>
Code:
.Watermark
{
    position: relative;
    width: 0;
    height:1.25em;
    vertical-align: top;
}
.Watermark label
{
    position: absolute;
    left: 0;
    top: 2px;
    white-space: nowrap;
    color: #999;
    padding-left: 4px;
    height: 1.25em;
    vertical-align: middle;
}
.InputBox
{
    width: 300px;
}
 
Old February 21st, 2011, 03:43 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,

When I copy and paste your code into a new file, this seems to work fine for me.

Maybe there's other code in your site that messes up the design?

I attached my demo page so you can see how it's set up.

Cheers,

Imar
Attached Files
File Type: txt Watermark.txt (1.2 KB, 23 views)
__________________
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:
Phil Critchley (February 21st, 2011)
 
Old November 22nd, 2011, 03:45 PM
Friend of Wrox
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile

Hi Imar,
Greetings!!

I am wrapping textboxes in ul element. I can see that watermark text is hidden beneath the textbox when position attribute is set to relative in ul element, but as soon as I remove this attribute the watermark appears on the textbox.
What is problem with relative value? Is there any fix to it as I want to use relative value for the position attribute.

Code:
ul input[type="text"], ul input[type="password"]
        {

            width:300px;

            padding:5px;

            position:relative;
}
the web page code is
Code:
<ul><li><input type="text" title="enter value" /></li></ul>
 
Old November 22nd, 2011, 04:32 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Are you using the plugin for the watermarks? If so, it may not support this positioning option. Not sure though.... Maybe the plugin page has more info?

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 November 23rd, 2011, 01:27 PM
Friend of Wrox
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile

Hi Imar,
Link http://plugins.jquery.com/project/updnWatermark does not exist anymore.

Even I searched plugin on jquery site but got nothing.
Kindly update the link if you get the new one.

Thanks
 
Old November 23rd, 2011, 01:30 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

http://updatepanel.net/?p=579

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 November 23rd, 2011, 03:00 PM
Friend of Wrox
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile

thanks Imar for link...
 
Old November 23rd, 2011, 03:33 PM
Friend of Wrox
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Default

Where we can download vsdoc file of jquery from?
thanks...
 
Old November 23rd, 2011, 04:13 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

From Google? https://www.google.com/#sclient=psy-...=1050&bih=1262

Also, I think you can get it through NuGet.....
__________________
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 November 24th, 2011, 11:15 AM
Friend of Wrox
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile

Hi Imar,
The maximum version I could get is 1.5 of vsdoc. Isn't there vsdoc for 1.7 version? or 1.4.1 vsdoc is compatible with jquery 1.7 version?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chp 7 Caption & Watermark p202 aformoftruth BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 4 March 4th, 2010 06:21 AM
Servoy Plugin elizas MySQL 1 January 27th, 2010 09:23 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
getdatasource in plugin ashok BOOK: Professional Jakarta Struts 0 July 1st, 2004 03:32 AM





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