 |
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
|
|
|
|
|

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

February 21st, 2011, 03:43 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|
The Following User Says Thank You to Imar For This Useful Post:
|
|
|

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

November 22nd, 2011, 04:32 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

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

November 23rd, 2011, 01:30 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
|
|

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

November 23rd, 2011, 03:33 PM
|
|
Friend of Wrox
|
|
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
|
|
Where we can download vsdoc file of jquery from?
thanks...
|
|

November 24th, 2011, 11:15 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
|
|
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?
|
|
 |
|