Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
[ask] Date Validation using JQuery Validation
Old 01-18-2010, 08:04 PM [ask] Date Validation using JQuery Validation
Novice Talker

Posts: 10
Name: adi sembiring
Trades: 0
Hi ..., I'm trying to validate date using jquery validation. Included Javascript Library is:

HTML Code:
<script type="text/javascript" src="<?php echo base_url()?>asset/jqueryui/ui/ui.core.js"></script>
            <script type="text/javascript" src="<?php echo base_url()?>asset/jqueryui/ui/ui.datepicker.js"></script>
            <script src="<?php echo base_url()?>asset/jquery/jquery.metadata.js" type="text/javascript"></script>
            <script src="<?php echo base_url()?>asset/jqvalidate/jquery.validate.js" type="text/javascript"></script>
Supposed I have 3 input field. name, address, and date of bird and I use errorContainer to display error.

my javascript is:

HTML Code:
<script type="text/javascript">
                    $().ready(function() {
                        
                        var errorContainer = $('div.errorContainer');
                        // validate the form when it is submitted
                        var validator = $("#frm").validate({
                            errorContainer: errorContainer,
                            errorLabelContainer: $("ol", errorContainer),
                            wrapper: 'li',
                            meta: "validate",
                            rules: {
                                field: {
                                  required: true,
                                  date: true
                                }
                              }
                        });
                    });
        
                    $(function(){
                        $("#datepicker").datepicker();
                    });
                    </script>

    <form id="frm">
    <input type="text" id="name" name="name" class="field text {validate:{required:true}}">
    <input type="text" id="address" name="address" class="field text {validate:{required:true}}">
    <input type="text" id="datepicker" name="datepicker">
    <input type="submit">
    </form>
but It doesnt work for date validator.

I need your help. thanks
gun41zuntuk is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to [ask] Date Validation using JQuery Validation
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10660 seconds with 12 queries