jquery start date end date validation

Ads
 

jquery start date end date validation

Using JQuery how can i validate the end date and start date? for example if the start date is grater than the end date?

View Answers

March 23, 2012 at 3:02 PM

jQuery.validator.addMethod("greaterThan", 
function(value, element, params) {

    if (!/Invalid|NaN/.test(new Date(value))) {
        return new Date(value) > new Date($(params).val());
    }

    return isNaN(value) && isNaN($(params).val()) 
        || (parseFloat(value) > parseFloat($(params).val())); 
},'Must be greater than {0}.');
To use it:

$("#EndDate").rules('add', { greaterThan: "#StartDate" });
or

$("form").validate({
    rules: {
        EndDate: { greaterThan: "#StartDate" }
    }
});

Ads









Related Tutorials/Questions & Answers:
jquery start date end date validation
jquery start date end date validation  Using JQuery how can i validate the end date and start date? for example if the start date is grater than the end date?   jQuery.validator.addMethod("greaterThan", function(value
SQL get start date and end date result
SQL get start date and end date result  how to get ( 15 march 2011) and (15/03/2011) output using SQL
Advertisements
JQuery date change event
designing a date form in HTML and JQuery, wher i need two different date vales start... users to choose from start & end date. But i want is .. if a user is choosing any specific start date then end date should automatically get change by adding
Date Validation
Date Validation  Hi, I need Date Validation using java in spring framework. Please Anyone help me... Thanks in advance
date validation
date validation  sir, pls provide date validation code in javascript..we want to include it into our master form..   Please visit the following link: http://www.roseindia.net/mysql/datevalidation.shtml
Date validation
Date validation  How to validate date in jsp? That is i have a textbox which will have the value from the date picker. How to validate the date that should be entered in a specified format?   Hi Friend, Please visit
jquery date picker
jquery date picker  how can i compare the dates on click from a calendar with the dates that are stored in database
jquery date picker
jquery date picker  I am developing a business calendar.i used the Jquery datepicker plugin.I just now want to get the dates from the the calendar... dates should be from database.   JQuery Datepicker
javascript date validation using regex
javascript date validation using regex  Hi, I want to validate the date using javascript. Please help.   <html> <head> <title>Validating Date format</title> <script type="text/javascript">
date
date   how to insert date in database? i need coding
date
date  can u tell me how to calculate difference between a user provided date and the system date in java
date
date  can u tell me how to calculate difference between a user provided date and the system date in java
date
date  i want difference between the date entered in a jtextfield and the system date in java
date
date  how to insert date using html through the combobox
date
date  how to insert date using html through the combobox
date
date  how to insert date using html through the combobox
date
date  how to insert date using html through the combobox
date
database table name birthday (DOB date); dob with DATE data type in database while...=d.getTime(); java.sql.Date date = new java.sql.Date(t); try { System.out.println(date); Class.forName("oracle.jdbc.OracleDriver"); con
DATE
DATE  I have the following as my known parameter Effective Date... of calcultion starts My question is how to find the date of Thursday This cycle... the date of all the thursdays of the given year. import java.util.*; import
Date validation in JSP
Date validation in JSP       Example for validating date in a specified format in a JSP page This example illustrates how to use date validation in a JSP page. Here in this code we are using
Finding A Date
Finding A Date  My Frequency Start Date is 24-08-2012 My frequency end date - not defined Calculation Frequency is Weekly(Sunday) My calculation... the following date of sunday
display date to jsp from database
display date to jsp from database   display date to jsp from database to calender if the start date and end date is available than calender date... which is available in Between Start date & End Date also show red color and non
convert current date into date format
convert current date into date format  How to get current date and convert into date format in Java or PHP
date convertion
date convertion  How to convert the string date format 23/11/2009 to original date format in asp.net
Mysql Date from Date
Mysql Date from Date       Mysql  Date from Date Time in Mysql return the Current  date. Understand with Example The Tutorial illustrate an example from 'DateTime
Date Picker
. But our requirement is a little different one . After the start date is selected in the calendar( by using date picker ) it needs to get updated/highlighted...Date Picker   Hi Java Developers ! I came across the coding for date
Date Example
();         Date strtime = new Date();         System.out.println("Start Time: " + strtime);         Date endtime = new Date();         System.out.println("End Time... Date Example      
Java Date
Java Date  Hi, What is the API for Date management in Java? How use the Java Date API for manipulating date object in Java? Provide some... of API for working with date and time objects in Java. You can also use third
Date Picker
Date Picker  "I want to set default calendar date when using datepicker. This date means auto-loaded date when the calendar appears. The default date is the current date. I want to change it. How could I do
date print
date print  how can i print the date in jsp page in the following formate month-date-year. (example. march 8 2012
date print
date print  how can i print the date in jsp page in the following formate month-date-year. (example. march 8 2012

Ads