treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Disable script if device has input type="date" support?

  • Hi all,

    Does anyone know of a way that I can effectively disable or unload a script if input type="date" is supported?

    I'm doing a design right now that I'm using datepicker.js for a dropdown to select a start and finish date for staying at a country house.

    However, I would like to use the built in date picker that comes on iOS and other browsers.

    Is there a way to disable the javascript that creates the drop down gallery if the device supports input type="date" natively?

    Linky here: Contact Page
  • Instead of disabling a script, why not use Yepnope.js to load the script if needed.
  • Thanks @mottie, hadn't thought of going the other way around! Just googled it and found this on here if anyone else is looking to do something similar.

    Progressively Enhancing HTML5 Forms