Click here to Skip to main content
16,016,669 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
need help....

will you please share me your great talent out there friends...



shukran kateer....
Posted
Comments
@p@richit 17-Sep-14 3:27am    
what you want to do ?can you clarify your issue.
RadumixMatsad 17-Sep-14 3:46am    
i want to make watermark image or text in textbox like for "log-in form" but in asp.net.

thats it boss...

Google is your friend: be nice and visit him often. He can find information a lot faster than post it here...

A simple search using your subject as the search topic found 27,000 hits: Google[^]
The top one is from MSDN: How to: Add a Watermark to a TextBox[^]

In future, try to do at least basic research yourself, and not waste your time, or ours.
 
Share this answer
 
Try with this

ASP.NET
<head runat="server">
    <title></title>
    <script src="Javascript/jquery-1.4.1.js" type="text/javascript"></script>
    <style type="text/css">
        .watermark
        {
            background-image: url('images/background.gif');
            background-repeat: no-repeat;
            vertical-align: middle;
            color: gray;
        }
    </style>
</head>
<body>
    <script type="text/javascript">
        $(document).ready(function () {
            var defaultText = "please enter your name";


            if ($('#txtName').val() == "" || $('#txtName').val() == defaultText) {
                $('#txtName').addClass("watermark");
                $('#txtName').val(defaultText);
            }


            $('#txtName').blur(function () {
                var title = this.title
                if ($(this).val() == "") {
                    $(this).val(defaultText);


                    $(this).attr("class", "watermark");
                }
            });


            $('#txtName').focus(function () {
                var title = this.title
                if ($(this).val() == defaultText) {
                    $(this).val("");
                    $(this).removeClass("watermark");
                }


            });
        });
    </script>
   <form id="form1" runat="server">
    <div>
      <asp:textbox id="txtName" runat="server" width="150px" tooltip="please enter your name" xmlns:asp="#unknown"></asp:textbox>
    <asp:button id="Button1" runat="server" text="submit" xmlns:asp="#unknown" />
    </div>
   </form>
</body>


For More information Follow this article[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900