Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
Node is saved as draft in My Content >> Draft
  • Javascript validation with date picker

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 52
    Comment on it

    For providing client side validations you need to use JavaScript or jquery for that.

    For doing that you need to use libraries that support jquery functions and methods for providing validations.

    This code includes both validation as well as calendar extender or date picker, See the below example

     

    <head runat="server">
        <title></title>
        <link href="Styles/ValidationEngine.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css" />
        <link href="Styles/Site.css" rel="stylesheet" />
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
        <script type="text/javascript" language="javascript">
            $(function () {
                $("#<%=txtBirthDate.ClientID %>").datepicker({
                    changeMonth: true,
                    changeYear: true
                });
    
                $("#<%=txtBirthDate.ClientID %>").on('change', function () {
                    $("div.txtBirthDateformError").remove();
                });
            });
        </script>
    
        <script src="http://code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
        <script type="text/javascript" src="http://cdn.ucb.org.br/Scripts/formValidator/js/languages/jquery.validationEngine-en.js"
            charset="utf-8"></script>
        <script type="text/javascript" src="http://cdn.ucb.org.br/Scripts/formValidator/js/jquery.validationEngine.js"
            charset="utf-8"></script>
        <script type="text/javascript">
            $(function () {
                $("#form1").validationEngine('attach', { promptPosition: "topRight" });
            });
        </script>
    
    </head>
    
    Javascript

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: