SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard
    Join Date
    May 2012
    Posts
    1,159
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Having problem in slect opton

    Hi, I am having problem using select option, how do i make datepicker work in the select option ?


    Code:
     $('selctoption').datepicker();

  2. #2
    SitePoint Addict
    Join Date
    Oct 2009
    Location
    London, UK
    Posts
    382
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    That's not a very well formed question jemz!

    I assume you are using jQuery, and I assume you are using a plugin, which has a method datepicker();

    if that is the case, what exactly are you trying to select? If you have an element on your page with the id selectoption, then this should work:
    Code:
    $('#selectoption').datepicker();
    if its class is selectoption, then this should do the trick:
    Code:
    $('.selectoption').datepicker();
    if you want to select all select tags, you want this:
    Code:
    $('select').datepicker();
    Perhaps you could include the HTML so I have a least a chance to try and understand what you are trying to achieve.

    M

  3. #3
    SitePoint Wizard
    Join Date
    May 2012
    Posts
    1,159
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    hi, that id is in my <select></select> it will not work using select,have you tried using select with datepicker?

  4. #4
    SitePoint Addict
    Join Date
    Oct 2009
    Location
    London, UK
    Posts
    382
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    In your original post you put:
    Code:
    $('selctoption').datepicker();
    Are you sure on the spelling of your id? Surely 'selectoption' rather than 'selctoption' (missing e). And to select an id with jQuery, you need to add a # sign at the start (like a css selector):
    Code:
    $('#selectoption').datepicker();
    Please post your HTML. That way I can be more help to you.

  5. #5
    SitePoint Wizard
    Join Date
    May 2012
    Posts
    1,159
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    sorry, yes i put # i tried using textfield and i have no problem,but only tag <select> is my problem in datepicker.

  6. #6
    SitePoint Addict
    Join Date
    Oct 2009
    Location
    London, UK
    Posts
    382
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure the datepicker plugin works with <select> tags.

    Can't really help much because you HAVEN'T POSTED YOUR HTML! OR YOUR JAVASCRIPT!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •