PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Datepicker showing up for all fields

  1. sandrakidd
    Member

    Hi,

    I have used the following JS to blockout Sundays and Mondays for my form, but it's causing the datepicker to pop up in every field in the form.

    <script type="text/javascript">
    $(document).ready(function(){
        $('input').datepicker({beforeShowDay: function(date){
            return [(date.getDay() > 1), ''];
        }});
    });
    </script>

    Here is a link to the page with the form: http://alturl.com/jiptg

    Any ideas as to how to get around this?

    Thanks!

    Posted 12 years ago on Monday March 19, 2012 | Permalink
  2. looks like you're applying this to just the 'input" tag rather than just specific inputs.. That's why it's showing with every field.. because they're all using the 'input' element.. it should be something more like this.. you would need to view your source and find the actual ID of your datepicker field and plug it in.

    [js]
    $(document).ready(function(){
        $('input#input_1_25').datepicker({beforeShowDay: function(date){
            return [(date.getDay() > 1), ''];
        }});
    });
    Posted 12 years ago on Monday March 19, 2012 | Permalink
  3. sandrakidd
    Member

    Perfect - that did the trick! Thanks so much!

    Posted 12 years ago on Monday March 19, 2012 | Permalink
  4. Wonderful. Glad that helped out. Thanks for the update.

    Posted 12 years ago on Monday March 19, 2012 | Permalink

This topic has been resolved and has been closed to new replies.