On my page https://fiftyallstars.com/50/curriculum.html , I have some basketball drills loading from a google spreadsheet of mine. Only thing is after it loads, I can't seem to get the datepicker to show today's date. My players get confused by having to select the date each time, and I'd rather it just default to today's date instead. Looking around the web, I stumbled upon a code that looked like it should work but did not $(document).ready(function() { $('#txtDate').datepicker(); $('#txtDate').datepicker('setDate', 'today'); }); Assuming that's close, could someone help me perfect it and maybe tell me where exactly to add it? Or, if …

Member Avatar
Member Avatar
+0 forum 6

I have a yearly curriculum for my basketball workouts that I'd like to display online. I've created 53 unique workouts for each day of the week that include the main focus for the day, 6 drills, a quote, and a motivational story. I know I'd need a [datepicker](https://jqueryui.com/datepicker/) to accomplish this and the logic must employ both a [week number script](https://weeknumber.net/how-to/javascript) and a [getDay script](https://docs.microsoft.com/en-us/scripting/javascript/reference/getday-method-date-javascript), but I have absolutley no idea on how to get started from there. As the page loads, it should show today's workout. eg If it's the 17th Monday of the year, it would show that …

Member Avatar
Member Avatar
+0 forum 10

Hi Php'ers, I'm new to Php. I have some issues INSERTING date to MySQL by PHP. here's my code snippet: //date format $date1 = mysqli_real_escape_string($_POST['j_avail']); $d1 = date('Y-m-d',($date1)); $date2 = mysqli_real_escape_string($_POST['j_expir']); $d2 = date('Y-m-d',($date2)); the query: $sql = "INSERT INTO table (....,j_avail,j_expir) VALUES (....,'$d1','$d2')"; the HTML: <td id="ititle">Availability :</td> <td><input type="date" name="avail" id="datep"></td> </tr> <tr> <td id="ititle">Expiration :</td> <td><input type="date" name="exp" id="datep"></td> </tr> When i execute my the code and check my db i get this 1970-01-01. i also have tried strtotime it also gives me this result. Dont know whats the issue here. hmmmm Thanks. OTEP

Member Avatar
Member Avatar
+0 forum 2

Hi al you wonderful daniweb peoplez :) I am currently on a mission to write some cool javascript / jquery / ajax controls and now i realised that if I call the control multiple times it seems to lose scope. I realise that this is a small design flaw, and would lie to know how I can correct this? I would like to create new instances for each call. Here is the javascript that would create the control: var testProperties = { testControlId: '', defaultText: 'Hello World', }; $.fn.watermarkInput = function watermarkInput(newProperties) { // Make sure that all settings have …

Member Avatar
+0 forum 0

I have a datepicker which is set up to select a whole week. I have two buttons which are supposed to move the selected dates forward and backward a week. The forward button works all the time, but the backward button only works if the month changes. If the month does not change nothing happens. The code is below. $(document).ready(function() { $(function() { var startDate; var endDate; var selectCurrentWeek = function() { window.setTimeout(function() { $('.week-picker').find('.ui-datepicker-current-day a').addClass('ui-state-active')}, 1); } $('.week-picker').datepicker({ showOtherMonths: true, selectOtherMonths: true, onSelect: function(dateText, inst) { var date = $(this).datepicker('getDate'); startDate = new Date(date.getFullYear(), date.getMonth(), date.getDate() - date.getDay()); endDate …

Member Avatar
Member Avatar
+0 forum 1

How can I prevent the user from typing in a date or anything else in the <input> element connected with a jQuery datepicker ?

Member Avatar
Member Avatar
+0 forum 4

hi i have used datepicker for picking date and i need to validate for empty value .i should not allow the user to go to next page without selecting any dates how to do that ..

Member Avatar
Member Avatar
+0 forum 10

how to insert date in table by using datepicker jquery? my jquery code is as: <script language="JavaScript" type="text/javascript"> $(function() { $( "#date" ).datepicker(); }); </script> in html <tr colspan="2"> <td valign="top" align="left"> Date<font color="red">*</font></td> <td valign="top" align="left"> <input type="text" id="date" name="date" value="" readonly="readonly" autocomplete="off" size="20"> </td></tr>

Member Avatar
Member Avatar
+0 forum 4

Hi i have input type text as date with a value of "2013-12-25" and i have a database with a field of month and a value of (December) and Year (2013). How can i convert the value of (2013-12-25) to a string of December and Year so i can use it to my Select Persons from Customer where Month = '$Month' and Year = '$Year'

Member Avatar
Member Avatar
+0 forum 2

Script i am using shown below.Date picker is showing on screen but it is applying to all input fields.( WHat should i change to get only for a particular input field. I tried with id rangeA but still it is applying to all fields. <script type="text/javascript"> $(function() { $('input').daterangepicker({arrows:true}); }); </script> <form> <li> <label for="name">Your Name:</label> <input type="text" size="40" id="name" /> </li> <li> <label for="date">Select Date</label> <input type="text" value="4/23/99" id="rangeA" /> </li> </form>

Member Avatar
Member Avatar
+0 forum 5

Hullo, I am working with a datepicker that allows users to enter a date schedule for given tasks. However, I want the dates that have passed to be disabled from the datepicker, so that the user only selects a future date. Here is what I am using currently; <script type="text/javascript"> $(function() { //var altFormat = $( "#datepicker" ).datepicker( "option", "altFormat" ); $( "#datepicker" ).datepicker({ dateFormat: 'yy-mm-dd',changeYear:true,changeMonth:true,yearRange:'1900:2002'}); //getter var dateFormat = $( "#datepicker" ).datepicker( "option", "dateFormat" ); //setter $( "#datepicker" ).datepicker( "option", "dateFormat", 'yy-mm-dd' ); });

Member Avatar
Member Avatar
+0 forum 7

Hi everyone, I'm working in a project where its required a dynamic insertion of a grup of 3 textfields where one hiels dates. So far I manage to do the insertion part, but Im still with the problem of jquery datepicker only working right on the first(original) textfield. I notice an error when inserting new textfield and trying to access the jquery datepicker "Uncaught TypeError: Cannot read property 'append' of undefined"! I searched the web and i found that it can ve fixed by creating a class on the textfield and adding "'removeClass' or the 'not' ". $('.datepicker').removeClass('hasDatepicker'); I tried …

Member Avatar
Member Avatar
+0 forum 5

Hi I have a datepicker: <input class="dmxCalendar2" name="dmxCalendar21" id="dmxCalendar21" /> <script type="text/javascript"> // <![CDATA[ jQuery(document).ready( function() { jQuery("#dmxCalendar21").dmxCalendar2( {"altFormat": "yy-mm-dd", "condDates": [], "firstDay": 1, "showOn": "both", "duration": "slow", "showOptions": {"direction": "up", "easing": "swing"}, "yearRange": "c-10:c+10", "onSelect": "MM_goToURL('parent','allactstest.html');"} ); } ); // ]]> </script> And also a script: <script> var chosenDate = (document.getElementById("dmxCalendar21").value !="" )? document.getElementById("dmxCalendar21").value : '2012-08-14' ; function checkDate(rgn, doIt) { if (doIt('{dsDates::datebooked}') == chosenDate) { Spry.Utils.addClassName('id'+doIt('{dsArtists::@id}'),'hidden'); } } </script> I'm trying to make it so that when a date is picked it will connect with the 'var chosenDate' part of the script. I've tried getElementById but it does'nt …

Member Avatar
Member Avatar
+0 forum 1

In my application, users often need to go to `+1` or `-1` day from the current selected date. For this, I want to make this process more quick by adding two image buttons for +1 and -1 operation on the right side and the left side respectively. I have tried this: $('#date').datepicker('setDate', '-1'); But it always set the +1 date from the current date (that is today -1, not the -1 from the selected date). How can I achieve this..?? Any help would be appreciable. ## Tried Later: ## function AddDays(arg) { var d = $('#date').datepicker('getDate'); var d = new …

Member Avatar
Member Avatar
+0 forum 2

how to implement, onclick on radio button datepicker has to appear otherwise it should be hidden.

Member Avatar
Member Avatar
+0 forum 3

I am using the following code to select a date range using 2 inline datepickers. There are two date fields (**div**, with class **dateheader**). When a date is selected, that datepicker slides up. Basically when the date **div** is **clicked**, first it is checked whether the corresponding datepicker is already viewable (through the **fromclicked** and **toclicked** variables), if present, then slide it up, else slide it down, changing the corresponding **clicked** attribute accordingly, and before doing either, sliding the other datepicker up and setting its corresponding **clicked** attribute to 0. Now there is a text input at the bottom of …

Member Avatar
+0 forum 0

I want to validate time format by putting time picker on my form, then i search for it in Internet and i found it [here](http://trentrichardson.com/examples/timepicker/). I follow the steps, but it is did't work. In my page i just want to receipt time (hh:mm). i need it to validate the time put by user. Anybody please help me using that timepicker. That time picker suitable for my form. What is the required library for that timepicker? If I may request, could anybody give me the code, please... I'm a new person in web development, and i'm interest. Help me please...

Member Avatar
Member Avatar
+0 forum 1

I am trying to make a datepicker that sets a maxDate of 2 **business days**. Right now I am using the following: $(document).ready(function() { $('#intnewDate').datepicker({ beforeShowDay: $.datepicker.noWeekends, inline: true, dateFormat: "mm/dd/yy", changeFirstDay: false, maxDate: 2 }); }); I am disabling weekends with $.datepicker.noWeekends, but when using maxDate: 2 it counts the days on the weekends. Anyone know a good way to ONLY count **business days** when using maxDate? I have a fiddle here: http://jsfiddle.net/nsP3L/3/

Member Avatar
+0 forum 0

I have a datepicker field that the maxDate doesn't seem to be working on. jQuery: $(document).ready(function() { $("#intorgDate").change(function() { var myDate = new Date($("#intorgDate").val()); //ENTER VALUE IN mm/dd/yy FORMAT var mymaxDate = new Date(myDate +7); $('#intnewDate').datepicker({ inline: true, dateFormat: "mm/dd/yy", changeFirstDay: false, defaultDate:myDate, minDate: myDate, maxDate: mymaxDate }); }); });​ HTML: org date:<br> <input type="text" id="intorgDate" /><br> new date:<br> <input type="text" id="intnewDate" /><br>​ I have also tried setting maxDate to: maxDate: myDate 7, maxDate: myDate +7, and myDate "+7" - All with no luck. You can see it in action here: http://jsfiddle.net/eQRqt/30/ What am I missing?

Member Avatar
Member Avatar
+0 forum 1

I have a form that auto-populates an "original date" field based on the previous field that is filled in. What I am looking to do is the following: Once the "original date" is auto-populated (in the format of 04/09/2012), I need the next field "new date" to automatically have a datepicker function bound to it that does the following: 1. Uses the date from the "original date" field as the defaultDate. 2. Disable all date prior to the defaultDate. 3. Only allow dates that are greater or equal to 23 days from the defaultDate. I have tried testing with the …

Member Avatar
+0 forum 0

Hi, I have 2 calendars using jquery UI datepicker. The first calendar is default to todays date. What I need to happen is for the second calendar default date to change to default date (of first calendar) + 1 day. I'm really not too sure how to do this... So any help would be great! This is the code I have so far: [CODE] $(document).ready(function(){ $("#startDate").datepicker({ dateFormat: "dd/mm/yy" }).val() $('#startDate').datepicker('setDate', new Date()); }); $(document).ready(function(){ $("#endDate").datepicker({ dateFormat: "dd/mm/yy" }).val() }); $('#startDate').datepicker({onSelect: function(dateStr) { $('#endDate').datepicker('option', 'defaultDate', dateStr); }}); $('#endDate').datepicker(); [/CODE]

Member Avatar
+0 forum 0

Hi, I'm having issues getting the datepicker to display. I've done quite a bit of research on it and found other people have had the same problem but I tried their fixes and it still doesn't work. The page is here [URL="http://www.purpleblaze.com.au/test%202/"]http://www.purpleblaze.com.au/test%202/[/URL] I'm really struggling on this and I've spent quite a few hours on it. I've done exactly as the website says and it still doesn't work. I also have a validator on there but I tried removing that too to see if it worked but it didnt. [CODE] <!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"> …

Member Avatar
Member Avatar
+0 forum 3

Embarrassed to say how many hours I've burned on this--am hoping someone can point me down the right path. This is more a conceptual question than a straight coding one. Building a web app to enable people to reserve stuff where I work. One of the pages uses a [URL="http://jqueryui.com/demos/datepicker/#date-range"]date range version[/URL]--the user picks an equipment category and the resulting call to the database fills the page with list of items, each of which has the twin datepickers for first and last date needed. I naïvely thought it would make sense to query the reservations table of the database in …

Member Avatar
Member Avatar
+0 forum 1

Hello people, I have downloaded a datepicker in order to use it in my script so as to allow people to pick their date of birth. The date picker in question is this one : core.ui.datepicker/ui.datepicker.js It works, but the problem is that it shows only the years that start from the current year . The user can pick a year former to the current year only by navigation by a mouse on a row. Suppose you are born on 1950 then you will make around 60 clicks to achieve your year of birth :( I want you tell you …

Member Avatar
Member Avatar
+0 forum 4

The End.