Search Results

Search found 488 results on 20 pages for 'datepicker'.

Page 2/20 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Jeditable Datepicker onblur problem

    - by Shobha Deepthi
    Hi, I am using inline editing using Jeditable and datepicker. I have a column in my table which displays Date as a hyperlink. When I click on this it shows me the datepicker. And when a particular date is selected its updated in the backend and the cell now is updated with the changed value. However, am having problem with onblur event while changing month or years. This event gets triggered when I click on "Prev" or "Next" buttons on the datepicker control. This causes an exception when the date is selected. This works fine as long as the date selected is in the current month. I tried all possible solutions listed here: stackoverflow.com/questions/2007205/jeditable-datepicker-causing-blur-when-changing-month If settimeout the control does not change back to a normal hyperlink on closing the datepicker or on a true onblur event. Here's my code, $.editable.addInputType('datepicker', { element : function(settings, original) { var input = $(''); if (settings.width != 'none') { input.width(settings.width); } if (settings.height != 'none') { input.height(settings.height); } input.attr('autocomplete','off'); $(this).append(input); return(input); }, plugin : function(settings, original) { var form = this; settings.onblur = function(e) { t = setTimeout(function() { original.reset.apply(form, [settings, self]); }, 100); }; $(this).find('input').datepicker({ changeMonth: true, changeYear: true, dateFormat: 'dd-M-y', closeAtTop: true, onSelect: function(dateText) { $(this).hide(); $(form).trigger('submit'); } }); }, submit : function(settings, original) { } }); $(function() { $('.edit_eta').editable('update_must_fix_eta.php', { id: 'bugid', name: 'eta', type: 'datepicker', event: 'click', select : true, width: '50px', onblur:'cancel', cssclass : 'editable', indicator : 'Updating ETA, please wait.', style : 'inherit', submitdata:{version:'4.2(4)',tag:'REL_4_2_4',qstr:1} }); }); I tried hacking jeditable.js as mentioned on this link: http://groups.google.com/group/jquery-dev/browse_thread/thread/265340ea692a2f47 Even this does not help. Any help is appreciated.

    Read the article

  • jQuery DatePicker - 'fake' click on page load

    - by Danny
    Hey! I've got a quick question about the jQuery UI DatePicker. When I load the page, defaultDate: 0 will work fine with selecting the current day's date. I would like to create a 'fake' click on the date so it will execute my JavaScript function and retrieve information from the database. I tried calling the function when the page loads but that doesn't work. $(document).ready(function(){ $("#datepicker").datepicker({ gotoCurrent: false, onSelect: function(date, inst) { ajaxFunction(date); }, dateFormat: 'dd-mm-yy', defaultDate: 0, changeMonth: true, changeYear: true }); }); //Browser Support Code function ajaxFunction(date){ var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ var ajaxDisplay = document.getElementById('ajaxDiv'); ajaxDisplay.innerHTML = ajaxRequest.responseText; } } var queryString = "?date=" + date; ajaxRequest.open("GET", "getDiary.php" + queryString, true); ajaxRequest.send(null); } function ajaxAdd(){ var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } var day1 = $("#datepicker").datepicker('getDate').getDate(); var day2 = (day1 < 10) ? '0' + day1 : day1; var month1 = $("#datepicker").datepicker('getDate').getMonth() + 1; var month2 = (month1 < 10) ? '0' + month1 : month1; var year1 = $("#datepicker").datepicker('getDate').getFullYear(); var year2 = (year1 < 1000) ? year1 + 1900 : year1; var fullDate = day2 + "-" + month2 + "-" + year2; var queryString = "?breakfast=" + diary1.breakfast.value; queryString = queryString + "&lunch=" + diary1.lunch.value; queryString = queryString + "&dinner=" + diary1.dinner.value; queryString = queryString + "&date=" + fullDate; ajaxRequest.open("GET", "addDiary.php" + queryString, true); ajaxRequest.send(null); alert("Added value to database!"); diary1.breakfast.value = ""; diary1.lunch.value = ""; diary1.dinner.value = ""; ajaxFunction(fullDate); } I have pasted my DatePicker class, and the two functions that are used (one to retrieve information from the database, and one to store). Basically I want to mirror the onSelect: function on the DatePicker, but when the page first loads. Thanks!

    Read the article

  • How to use JQuery UI datepicker with bgIframe on IE 6

    - by Steve Davies
    I am trying to use the JQuery UI datepicker (latest stable version 1.5.2) on an IE6 website. But I am having the usual problems with combo boxes (selects) on IE6 where they float above other controls. I have tried adding the bgIframe plugin after declaring the datepicker with no luck. My guess is that the .ui-datepicker-div to which I am attaching the bgIframe doesn't exist until the calendar is shown. I am wondering if I can put the .bgIframe() command directly into the datepicker .js file and if so, where? (the similar control by kelvin Luck uses this approach) Current code $(".DateItem").datepicker({ showOn:"button", ... etc ... }); $(".ui-datepicker-div").bgIframe();

    Read the article

  • jquery datepicker predefined date

    - by r3try
    This might seem like a stupid easy question to some of you, but i'm new to jquery and can't get my datepicker to work like it should. This is my textbox where the datepicker is attached to: <asp:TextBox runat="server" ID="StartMonth" AutoPostBack="true" class="month-picker" /> and here is how i attach the datepicker. (I have multiple TextBoxes where the datepicker should be attached to, so i used the class attribute instead of the id.) $(".month-picker").datepicker({ dateFormat: 'MM yy', changeYear: true, yearRange: '-9:+9' }); What i want to archive is when i click into the textbox where the text is "August 2012" it should set the pre-selected date of the datepicker to this date. Can anyone help? Kind regards.

    Read the article

  • Test if element already has jQuery datepicker

    - by macca1
    I have a form with many input elements. Some are date fields with a jQuery UI datepicker alraedy attached: $("#someElement").mask("9?9/99/9999").datepicker({showOn: 'button', buttonText:'Click here to show calendar', duration: 'fast', buttonImageOnly: true, buttonImage: /images/calicon.gif' }); Then I have a key command bound to this function: function openCalendar() { var selection = document.activeElement; // { Need to test here if datepicker has already been initialized $(selection).datepicker("show"); // } } This works great for elements which already have the datepicker on them. However any other fields will throw a javascript error. I'm wondering the best way to test to see if datepicker has already been initialized on that field.

    Read the article

  • jQuery UI DatePicker - Change Date Format

    - by tarnfeld
    I am using the UI DatePicker from jQuery UI as the stand alone picker.. i have this code <div id="datepicker"></div> And the follow JS $('#datepicker').datepicker(); When i try to return the value with this code: var date = $('#datepicker').datepicker('getDate'); I am returned this... Tue Aug 25 2009 00:00:00 GMT+0100 (BST) Which is totally the wrong format... Is there a way i can return DD-MM-YYYY ??

    Read the article

  • jQuery datepicker years shown

    - by John Boker
    With the jQuery datepicker, how does one change the year range that is displayed? On the jQuery UI site it says the default is "10 years before and after the current year are shown". I want to use this for a birthday selection and 10 years before today is no good. Can this be done with the jQuery datepicker or will I have to use a different solution? link to datepicker demo: http://ui.jquery.com/repository/latest/demos/functional/#ui.datepicker

    Read the article

  • Ruby on Rails: jQuery datepicker - dates between validation

    - by Jazz
    I have an app that allows a user to create new projects, and the search for them later. One of the options they have when creating a project is giving them start and end dates. At the moment all the code works properly for creating and searching on the dates, but I am now wanting to restrict what dates the user can enter. I am needing for an error to flag up when the user tries to enter an end date that is before the start date. It's really more for when the user is creating the project. Here is my code so far = Application.js //= require jquery //= require jquery_ujs //= require jquery-ui //= require jquery.ui.all //= require_tree . $(function() { $("#project_start_date").datepicker({dateFormat: 'dd-mm-yy'}); }); $(function() { $("#project_end_date").datepicker({dateFormat: 'dd-mm-yy'}); }); jQuery(function(){ jQuery('#start_date_A').datepicker({dateFormat: "dd-mm-yy"}); }); jQuery(function(){ jQuery('#start_date_B').datepicker({dateFormat: "dd-mm-yy"}); }); New View: <div class="start_date" STYLE="text-align: left;"> <b>Start Date:</b> <%= f.text_field :start_date, :class => 'datepicker', :style => 'width: 80px;' %> </div> <div class="end_date" STYLE="text-align: left;"> <b>End Date:</b> <%= f.text_field :end_date, :class => 'datepicker', :style => 'width: 80px;' %> </div> Search View: Start dates between <%= text_field_tag :start_date_A, params[:start_date_A], :style => 'width: 80px;' %> - <%= text_field_tag :start_date_B, params[:start_date_B], :style => 'width: 80px;' %></br> I tried following examples online to get this to work by doing this in the application.js file: $(function() { $("#project_start_date,#project_end_date").datepicker({dateFormat: 'dd-mm-yy'}); }); jQuery(function(){ jQuery('#start_date_A,#start_date_B').datepicker({dateFormat: "dd-mm-yy"}); }); But then the script doesn't run. I am new to rails and javascript so any help at all is appreciated. Thanks in advance. UPDATE: Don't know why my question has been voted to be closed. It's quite simple: I need an error to flag up when the user tries to enter an end date that is before the start date. How can I do that??

    Read the article

  • jQuery datepicker getMinDate '+1d'

    - by Adrian Adkison
    Once I have set the minDate property of a datepicker with the convenient string syntax $(elem).datepicker('option','minDate','+1d +3m'); how can I get the date object of the minDate? To help illustrate, there is a method $(elem).datepicker('getDate'); which returns the date that is entered in the input in the format of a date object. I would like the same thing but for datepicker('getMinDate'). There is an option like this $(elem).datepicker('option','minDate'); but this returns '+1d +3m' which is not helpful. I need the actual date object to compare with another date object. Any ideas?

    Read the article

  • Jquery Datepicker not selecting the default date

    - by Chirantan
    I have my datepicker set up like this $("#scheduled_date_163").datepicker({ onSelect: function(dateText, inst) { jQuery.get("/tasks/inplace_edit?id=scheduled_date_163&class_name=Task&value=" + dateText, function(data){ $('#scheduled_date_163').html(data); $('#scheduled_date_163').removeClass('hasDatepicker'); }) } }); $('#scheduled_date_163').datepicker( "option", "defaultDate", $.datepicker.parseDate("d m y", "31 8 2009") ); As you can see the date is hardcoded. It is supposed to be replaced with some code. However, the datepicker refuses to pick the date up! It always shows me the current date. Unable to figure out why. I even tried giving the date in string and +7 etc. But today's date itself is shown as the default date. What could be causing this?

    Read the article

  • How to select a dynamic datepicker instance in order to extend it with jQuery

    - by JaredC
    I'm trying to control positioning of a jQuery datepicker element. I like the solution offered at http://stackoverflow.com/questions/1818670/how-to-control-positioning-of-jqueryui-datepicker for overriding the _checkOffset fn: $.extend(window.DP_jQuery.datepicker,{_checkOffset:function(inst,offset,isFixed){return offset}}); However, this results in a 'window.DP_jQuery is undefined' error. Upon inspection, I can see that the DP_jQuery object in the DOM gets named with a random string, like so: DP_jQuery_123456. If I use this full name in the above code, it works wonderfully. My question is whether there's a way to exend the _checkOffset fn for a datepicker instance without knowing before-hand what the instance name is? For example, can I use some sort of wildcard to select all datepicker instances that begin with 'DP_jQuery_'? Thanks

    Read the article

  • setting minDate in datepicker in Rails

    - by Sakshi Jain
    I need to apply minDate attribute to the datepicker in Rails App. In _admin_controls.html.erb <%= f.input :end_date, wrapper: :append do %> <div id="datepicker" class="datepicker input-group edit-left"> <%= f.text_field :end_date, :class => "datetime form-control" %> application.js contains jQuery(document).on('focus', 'input.datetime', function() { opts = {format: 'M dd, yyyy', autoclose: true}; jQuery(this).datepicker(opts); jQuery(".datepicker").css("z-index",10000); }); What should be the javascript to do so only for _admin_controls.html.erb?

    Read the article

  • jQuery UI datepicker will not display - full code included

    - by Bill Brasky
    I am having trouble displaying the jQuery datepicker as shown here: http://jqueryui.com/demos/datepicker/ I believe I downloaded all of the proper files, but to be certain, I started from scratch and ripped the demo site. Not all of it, but what I believed to be the important parts. The result is no datepicker to be shown and no javascript errors. Here is my full code sample: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="stylesheet" href="http://static.jquery.com/ui/css/base2.css" type="text/css" media="all" /> <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/base/jquery-ui.css" type="text/css" media="all" /> <link rel="stylesheet" href="http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css" type="text/css" media="all" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> <script type="text/javascript" charset="utf-8" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script> <script type="text/javascript" charset="utf-8"> jQuery(function(){ jQuery("#datepicker").datepicker(); }); </script> </head> <body> <input type="text" id="datepicker" class="hasDatepicker" /> </body> </html> Any help would be very much appreciated. Thanks!

    Read the article

  • Hover-to-click on jQuery UI datePicker 'next month' and 'prev month' not working

    - by user316727
    Hi there, I have a calendar which is meant to look much like the calendar in Outlook. There is a big field representing the hours in a day, and there is a date navigator. The navigator is the jQuery UI Datepicker. I want users to be able to navigate to a new day by clicking on a date in the datepicker, but also to be able to drag appointments over the datepicker and drop them on a specific date. I have that working now. I also want users, while they are dragging an appointment, to be able to move to next or previous month simply by hovering over the datepicker. So I've added a mouseenter and mouseleave event: one runs a setInterval function which sends a click every 1,5 seconds; the other cancels the interval function. This is where all sorts of things go wrong. As soon as one click has been triggered, the mouseleave function no longer works: in other words, the datepicker keeps flipping over to another month every 1,5 seconds. It seems that the datePicker interferes, or that the click event causes other things to go wrong. What can I do?

    Read the article

  • Jquery datepicker: disable federal holidays

    - by Abu Hamzah
    i am working on asp.net using C# and using jquery datepicker my question is, how can i disable dates which are federal holidays? i have a dynamic dates which comes from sql server. anybody have done something similar or any idea how can i achieve this? $(document).ready(function () { $('#endDate').datepicker({ showOn: 'button', buttonImage: '../images/Calendar.png', buttonImageOnly: true, onSelect: function () { }, onClose: function () { $(this).focus(); } }); $('#startDate').datepicker({ showOn: 'button', buttonImage: '../images/Calendar.png', buttonImageOnly: true, onSelect: function (dateText, inst) { $('#endDate').datepicker("option", 'minDate', new Date(dateText)); } , onClose: function () { $(this).focus(); } }); }); Thanks.

    Read the article

  • jQuery datepicker minDate variable

    - by d3020
    I'm usung the jQuery datepicker. In my "EndDate" textbox I'd like to use the date selected from the the "StartDate" textbox + 1. How do I do this? I tried this but didn't work. In my start date code I had... test = $(this).datepicker('getDate'); testm = new Date(test.getTime()); testm.setDate(testm.getDate() + 1); Then in my end date code I had... minDate: testm, but the end date still made all the days for the month available. Thanks. Edit. I'm curious as to why this doesn't work. In my start date datepicker I have this.. onSelect: function (dateText, inst) test = dateText Why can't I come down into my end date datepicker and say, minDate: test?

    Read the article

  • jquery datepicker: validate date mm/dd/yyyy

    - by Abu Hamzah
    i have a textbox adn a datepicker next to it and i am using asp.net and the user can enter the date as well select the date from datepicker. how would you validate if the date is entered correct? <script type="text/javascript"> $(document).ready(function () { $('#<%=StartDate.ClientID%>').datepicker({ showOn: 'button', buttonImage: '../images/Calendar.png', buttonImageOnly: true, onSelect: function () { }, onClose: function () { $(this).focus(); } }); }); </script>

    Read the article

  • jQuery UI datepicker performance

    - by Richard Ev
    I have a textbox on my web page that is used to specify a date, so I'd like to use the jQuery DatePicker. However, most of my users are locked into using IE6 and the performance of the jQuery DatePicker is a little sluggish in this browser. Can anyone recommend an alternate JavaScript date picker, or any means of improving the display performance of the jQuery DatePicker?

    Read the article

  • Jquery datePicker

    - by Shane
    I have slight issue with the jquery datepicker in that it displays ABOVE the target box. This is due to the way my page is set up. I found the issue with CSS in my page via firebug, unfortunately it conflicts with about 20 elements. Next I tried hooking into the "beforeShow event" which works but then after the event fires it just recalculates and puts it where ever it wants. beforeShow: function() { $('#ui-datepicker-div').show(); var offset = $('#ui-datepicker-div').offset(); $('#ui-datepicker-div').css({ top: (offset.top + 222) + 'px' }) } Does anyone else have any ideas how how I can reposition this? I just need to move it down by about 200 odd pixels.

    Read the article

  • jquery datepicker: select date as back as 6 months

    - by Abu Hamzah
    Start date: user can select start date as back as 6 months. example: if today is 04/23/2010 then i can go back up to 11/23/2009 but not more than 6 months. <script type="text/javascript"> $(document).ready(function () { $('#endDate').datepicker({ showOn: 'button', buttonImage: '../images/Calendar.png', buttonImageOnly: true, onSelect: function () { }, onClose: function () { $(this).focus(); } }); $('#startDate').datepicker({ showOn: 'button', buttonImage: '../images/Calendar.png', buttonImageOnly: true, onSelect: function (dateText, inst) { $('#endDate').datepicker("option", 'minDate', new Date(dateText)); } , onClose: function () { $(this).focus(); } }); }); update code: var currentDate = new Date(); var currentMonth = currentDate.getMonth() + 1; var sixMonths = currentMonth + 6 currentDate.setMonth(currentDate.currentMonth, sixMonths); var myNewCurrentDate = new Date(currentDate) $('#startDate').datepicker('option', { minDate: myNewCurrentDate }); i am getting currentDate = NaN

    Read the article

  • jQuery UI Datepicker - Disable specific days

    - by Sam
    Is there any (easy) way to set the jQuery UI Datepicker to disallow selection of specific, predetermined days? I was able to get this approach working, however, it produces a null error which prevents it from displaying in IE. 'natDays[...].0' is null or not an object Thanks in advance! UPDATE: Might help if I included some code, right? Anyway, most of this was taken straight from the aforementioned thread: natDays = [ [7, 23], [7, 24], [8, 13], [8, 14], ]; function nationalDays(date) { for (i = 0; i < natDays.length; i++) { if (date.getMonth() == natDays[i][0] - 1 && date.getDate() == natDays[i][1]) { return [false, natDays[i][2] + '_day']; } } return [true, '']; } function noWeekendsOrHolidays(date) { var noWeekend = $.datepicker.noWeekends(date); if (noWeekend[0]) { return nationalDays(date); } else { return noWeekend; } } $(function() { $("#datepicker").datepicker({ inline: true, minDate: new Date(2009, 6, 6), maxDate: new Date(2009, 7, 14), numberOfMonths: 2, hideIfNoPrevNext: true, beforeShowDay: $.datepicker.noWeekends, altField: '#alternate', }); }); Thanks again!

    Read the article

  • Call jquery datepicker from link and send the date through a post call

    - by Alex
    Hi all, I need to make the datepicker show when I click on a link and then send the selected date to a different page through a post call. T tried to use this code for the link call: $(".click-on-link").click(function(){ $('#datepicker').datepicker({ changeMonth: true, changeYear: true, dateFormat: 'dd/mm/yy', firstDay: 1 }); }); but it's not working. Any idea? Thanks!

    Read the article

  • datepicker common options but different altField altFormat

    - by Legio X
    Using jquery-ui datepicker I would like to use altField and altFormat to 2 datepickers on the same page but I can't figure out how to add these 2 options which are specific to each datepicker along with my common set of options. Code sample below. #dt1 does not work, but #dt2 works. How can I get #dt1 to work while using the datepickerOpts? var datepickerOpts = { minDate: -2, changeMonth: true, changeYear: true, dateFormat: 'yy-mm-dd' }; $('#dt1').datepicker(datepickerOpts, {altField: '#alt1', altFormat: 'mm-dd-yy' }); $('#dt2').datepicker({ minDate: -2, changeMonth: true, changeYear: true, dateFormat: 'yy-mm-dd', altField: '#alt2', altFormat: '@' });

    Read the article

  • update text on click of date with jQuery UI datepicker

    - by stevoyoung
    I have two related questions... How do I update an HTML element (let's say a p tag) with the correct date when I click on a day in the jQuery UI datepicker plug in? If I have another way to selecte a date aside from the datepicker, how do I then update the datepicker's selected date (it's adds a class of "ui-state-active" to the date)?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >