-3

How can I compare two date fields using Parsley JS?

How can get the start date, while changing the end-date dynamically?

<input type="text" id="start-date"/>
<input type="text" id="end-date"/>
er_Yasar
  • 150
  • 10
  • Possible duplicate of [Parsley.js date validation in v2.x](https://stackoverflow.com/questions/22969985/parsley-js-date-validation-in-v2-x) – M3talM0nk3y Aug 27 '17 at 05:52
  • 1
    It is not a duplicate... That Post is for single date validation. and this post for comparing two date. – er_Yasar Aug 27 '17 at 06:02
  • It can be easily done using plain JS. Are you open to doing that? – Nisarg Shah Aug 27 '17 at 06:14
  • @NisargShah : i know it is easy to write in plain js. i need to extend parsley validator.. that is my question. Raise up the vote, don't put unnecessarily – er_Yasar Aug 27 '17 at 06:33

1 Answers1

0

Is't simple (ParsleyJS)

data-parsley-equalto="#anotherfield"

from documentation:

Validates that the value is identical to another field's value (useful for password confirmation check).

<input type="text" data-parsley-equalto="#end-date" id="start-date"/>
<input type="text" data-parsley-equalto="#start-date" id="end-date"/>
Shahar Shokrani
  • 7,598
  • 9
  • 48
  • 91