0

I'm using jQuery datepicker in different product pages in my WordPress site.

Each of the pages required different conditions of datepicker. Such as disable specific dates, holidays, etc.

e.g.

  • if page 1 then datepicker will show this specific dates only
  • if page 2 then datepicker will show antoher specific dates which is different from "page 1"
  • if page 3 then datepicker will show another specific dates which will show different from "page 1" and "page 2"

The site url: http://www.mantisphotoexpeditions.in/expeditions/jimcorbett

You can see the datepicker in the "query" tab.

I'm also using ""contact form 7 datepicker"

ZygD
  • 22,092
  • 39
  • 79
  • 102
Mantis
  • 1
  • 1
  • 1
    You can use `window.location.href` to anlyze the url (`regex`, `split`,..) and then create a different `object` that will be passed to the `.datapicker() `function – Razorphyn Apr 19 '15 at 08:55
  • Use different id or class for each input field linked with datepicker – Shan Apr 20 '15 at 04:04
  • @Mantis I'm not a wordpress developer, but speaking in general if you can only access to jquery you should retrieve the url in a "secure" way and retrieve the part you need, check this:[Retrieve url](http://stackoverflow.com/questions/6941533/get-protocol-domain-and-port-from-url), then you have to do a `switch` or `if` statement to check the information and create a different object for each case with the datapicker option: `var optArr={opt1:value, opt2:value,...}` and finally pass it to `$( "#datepicker" ).datepicker({optArr});` – Razorphyn Apr 20 '15 at 05:53

0 Answers0