Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
XML
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="html_textbox_new.aspx.vb" Inherits="repeater_sample.html_textbox_new" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<style type ="text/css" >
  .contact_form ul {
    width:750px;
    list-style-position:outside;
    }
.contact_form li{
    position:relative;
    }
.required_notification {
    color:#d45252;
    margin:6px 0 0 0;
    display:inline;
    float:right;
}

.contact_form label {
    width:150px;
    margin-top: 3px;
    display:inline-block;
    float:left;
    padding:3px;
}

.contact_form input {
    height:20px;
    width:220px;
    padding:5px 8px;
}

--%>/* Button Style */
button.submit {
    background-color: #68b12f;
    border: 1px solid #509111;
    border-bottom: 1px solid #5b992b;
    color: white;
    font-weight: bold;
    padding: 6px 20px;
    text-align: center;
}
button.submit:hover {
    background-color: Lime ;
}
button.submit:active {
    border: 1px solid #20911e;
    background-color:Blue ;
}

    </style>
    <html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">
</script>
<meta charset="utf-8">
    <title>html_5 concept</title>
    <link rel="stylesheet" media="screen" href="styles.css />

</head>
<body>
<form class="contact_form" action="" method="post" name="contact_form">
<ul>
    <li>
         <h2>Contact Us</h2>
         <span class="required_notification">* Denotes Required Field</span>
    </li>
    <li>
           <label for="name" >Name:</label>
        <input type="text" name="name" id="insert" placeholder="disha" required pattern="[a-zA-Z]+" />

    </li>
      <li>
    <label for="email">Email:</label>
    <input type="text" name="email" placeholder="disha@gmail.com" required pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$"/>
    <span class="form_hint">Proper format "name@something.com"</span>
</li>
<li>
    <button class="submit" type="submit" >Submit Form</button>
    <button class="cancel" type="submit" >Cancel Form</button></li>
</ul>

</form>
</body>

<script type ="text/javascript" >

//    $("#cancel").on("click", function () {
//        $("contact_form").removeClass("text");
//    });
    //
    $(document).ready(function () {
        $('#cancel').live('click',function () {
            $(this).parents('form').find('input[type="text"]').val(' ');
                    });
    });

</script>
</html>
</asp:Content>
Posted
Comments
Sergey Alexandrovich Kryukov 12-Apr-14 1:41am    
What "patterns"? where is it mentioned. Clearing fields is as simple as assigned their value properties to empty string.
—SA
Sunasara Imdadhusen 15-Apr-14 5:39am    
Need more clarification for the same! what about the textbox require pattern!

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