Translate

Tuesday, 12 May 2015

Apply watermark text for text boxes in HTML in different Ways


we can apply water mark to html text boxes.

Using watermark plugin

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
  <script src="~/Scripts/WaterMark.min.js"></script>

    <script>
        $(document).ready(function () {
            $("#txtName,#Email,#Mobile").WaterMark();
        });
    </script>
<body>
<table>

        <tr>
            <td>Name:</td>
            <td>
                <input type="text" id="txtName" title="Enter Name" />
            </td>
        </tr>
        <tr>
            <td>Email:</td>
            <td>
                <input type="text" id="Email" title="Enter Email" /></td>
        </tr>
        <tr>
            <td>Mobile:</td>
            <td>
                <input type="text" id="Mobile" title="Enter Mobile" /></td>
        </tr>
    </table>

</body>





using naormal place holder

<body>

<form action="demo_form.asp">
  <input type="text" name="fname" placeholder="First name"><br>
  <input type="text" name="lname" placeholder="Last name"><br>
  <input type="submit" value="Submit">
</form>

</body>

No comments:

Post a Comment