By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,824 Members | 1,255 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,824 IT Pros & Developers. It's quick & easy.

DateTimePicker Problem !

100+
P: 106
Hi,
I have a problem with my DateTimePicker javascript code which i downloaded , the problem is when i pick the date and the date appears in my Text Field and i click Submit the date which i picked is not sent to the DB and instead the default value of the text field which is 00-00-0000 is Sent

so what i need is to make the value i picked replace the value of the Text Field
and i cant seem to get the Js code which i downloaded . i'm new to Javascript

Expand|Select|Wrap|Line Numbers
  1. //Javascript name: My Date Time Picker
  2. //Date created: 16-Nov-2003 23:19
  3. //Scripter: TengYong Ng
  4. //Website: http://www.rainforestnet.com
  5. //Copyright (c) 2003 TengYong Ng
  6. //FileName: DateTimePicker.js
  7. //Version: 0.8
  8. //Contact: contact@rainforestnet.com
  9. // Note: Permission given to use this script in ANY kind of applications if
  10. //       header lines are left unchanged.
  11.  
  12. //Global variables
  13. var winCal;
  14. var dtToday=new Date();
  15. var Cal;
  16. var docCal;
  17. var MonthName=["January", "February", "March", "April", "May", "June","July", 
  18.     "August", "September", "October", "November", "December"];
  19. var WeekDayName=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];    
  20. var exDateTime;//Existing Date and Time
  21.  
  22. //Configurable parameters
  23. var cnTop="200";//top coordinate of calendar window.
  24. var cnLeft="500";//left coordinate of calendar window
  25. var WindowTitle ="DateTime Picker";//Date Time Picker title.
  26. var WeekChar=2;//number of character for week day. if 2 then Mo,Tu,We. if 3 then Mon,Tue,Wed.
  27. var CellWidth=20;//Width of day cell.
  28. var DateSeparator="-";//Date Separator, you can change it to "/" if you want.
  29. var TimeMode=24;//default TimeMode value. 12 or 24
  30.  
  31. var ShowLongMonth=true;//Show long month name in Calendar header. example: "January".
  32. var ShowMonthYear=true;//Show Month and Year in Calendar header.
  33. var MonthYearColor="#cc0033";//Font Color of Month and Year in Calendar header.
  34. var WeekHeadColor="#0099CC";//Background Color in Week header.
  35. var SundayColor="#6699FF";//Background color of Sunday.
  36. var SaturdayColor="#CCCCFF";//Background color of Saturday.
  37. var WeekDayColor="white";//Background color of weekdays.
  38. var FontColor="blue";//color of font in Calendar day cell.
  39. var TodayColor="#FFFF33";//Background color of today.
  40. var SelDateColor="#FFFF99";//Backgrond color of selected date in textbox.
  41. var YrSelColor="#cc0033";//color of font of Year selector.
  42. var ThemeBg="";//Background image of Calendar window.
  43. //end Configurable parameters
  44. //end Global variable
  45.  
  46. function NewCal(pCtrl,pFormat,pShowTime,pTimeMode)
  47. {
  48.     if (document.getElementById(pCtrl).disabled) return;
  49.  
  50.     Cal=new Calendar(dtToday);
  51.     if ((pShowTime!=null) && (pShowTime))
  52.     {
  53.         Cal.ShowTime=true;
  54.         if ((pTimeMode!=null) &&((pTimeMode=='12')||(pTimeMode=='24')))
  55.         {
  56.             TimeMode=pTimeMode;
  57.         }        
  58.     }    
  59.     if (pCtrl!=null)
  60.         Cal.Ctrl=pCtrl;
  61.     if (pFormat!=null)
  62.         Cal.Format=pFormat.toUpperCase();
  63.  
  64.     exDateTime=document.getElementById(pCtrl).value;
  65.     if (exDateTime!="")//Parse Date String
  66.     {
  67.         var Sp1;//Index of Date Separator 1
  68.         var Sp2;//Index of Date Separator 2 
  69.         var tSp1;//Index of Time Separator 1
  70.         var tSp1;//Index of Time Separator 2
  71.         var strMonth;
  72.         var strDate;
  73.         var strYear;
  74.         var intMonth;
  75.         var YearPattern;
  76.         var strHour;
  77.         var strMinute;
  78.         var strSecond;
  79.         //parse month
  80.         Sp1=exDateTime.indexOf(DateSeparator,0)
  81.         Sp2=exDateTime.indexOf(DateSeparator,(parseInt(Sp1)+1));
  82.  
  83.         if ((Cal.Format.toUpperCase()=="DDMMYYYY") || (Cal.Format.toUpperCase()=="DDMMMYYYY"))
  84.         {
  85.             strMonth=exDateTime.substring(Sp1+1,Sp2);
  86.             strDate=exDateTime.substring(0,Sp1);
  87.         }
  88.         else if ((Cal.Format.toUpperCase()=="MMDDYYYY") || (Cal.Format.toUpperCase()=="MMMDDYYYY"))
  89.         {
  90.             strMonth=exDateTime.substring(0,Sp1);
  91.             strDate=exDateTime.substring(Sp1+1,Sp2);
  92.         }
  93.         if (isNaN(strMonth))
  94.             intMonth=Cal.GetMonthIndex(strMonth);
  95.         else
  96.             intMonth=parseInt(strMonth,10)-1;    
  97.         if ((parseInt(intMonth,10)>=0) && (parseInt(intMonth,10)<12))
  98.             Cal.Month=intMonth;
  99.         //end parse month
  100.         //parse Date
  101.         if ((parseInt(strDate,10)<=Cal.GetMonDays()) && (parseInt(strDate,10)>=1))
  102.             Cal.Date=strDate;
  103.         //end parse Date
  104.         //parse year
  105.         strYear=exDateTime.substring(Sp2+1,Sp2+5);
  106.         YearPattern=/^\d{4}$/;
  107.         if (YearPattern.test(strYear))
  108.             Cal.Year=parseInt(strYear,10);
  109.         //end parse year
  110.         //parse time
  111.         if (Cal.ShowTime==true)
  112.         {
  113.             tSp1=exDateTime.indexOf(":",0)
  114.             tSp2=exDateTime.indexOf(":",(parseInt(tSp1)+1));
  115.             strHour=exDateTime.substring(tSp1,(tSp1)-2);
  116.             Cal.SetHour(strHour);
  117.             strMinute=exDateTime.substring(tSp1+1,tSp2);
  118.             Cal.SetMinute(strMinute);
  119.             strSecond=exDateTime.substring(tSp2+1,tSp2+3);
  120.             Cal.SetSecond(strSecond);
  121.         }    
  122.     }
  123.     winCal=window.open("","DateTimePicker","toolbar=0,status=0,menubar=0,fullscreen=no,width=250,height=245,resizable=0,top="+cnTop+",left="+cnLeft);
  124.     docCal=winCal.document;
  125.     RenderCal();
  126. }
  127.  
  128. function RenderCal()
  129. {
  130.     var vCalHeader;
  131.     var vCalData;
  132.     var vCalTime;
  133.     var i;
  134.     var j;
  135.     var SelectStr;
  136.     var vDayCount=0;
  137.     var vFirstDay;
  138.  
  139.     docCal.open();
  140.     docCal.writeln("<html><head><title>"+WindowTitle+"</title>");
  141.     docCal.writeln("<script>var winMain=window.opener;</script>");
  142.     docCal.writeln("</head><body background='"+ThemeBg+"' link="+FontColor+" vlink="+FontColor+"><form name='Calendar'>");
  143.  
  144.     vCalHeader="<table border=1 cellpadding=1 cellspacing=1 width='100%' align=\"center\" valign=\"top\">\n";
  145.     //Month Selector
  146.     vCalHeader+="<tr>\n<td colspan='7'><table border=0 width='100%' cellpadding=0 cellspacing=0><tr><td align='left'>\n";
  147.     vCalHeader+="<select name=\"MonthSelector\" onChange=\"javascript:winMain.Cal.SwitchMth(this.selectedIndex);winMain.RenderCal();\">\n";
  148.     for (i=0;i<12;i++)
  149.     {
  150.         if (i==Cal.Month)
  151.             SelectStr="Selected";
  152.         else
  153.             SelectStr="";    
  154.         vCalHeader+="<option "+SelectStr+" value >"+MonthName[i]+"\n";
  155.     }
  156.     vCalHeader+="</select></td>";
  157.     //Year selector
  158.     vCalHeader+="\n<td align='right'><a href=\"javascript:winMain.Cal.DecYear();winMain.RenderCal()\"><b><font color=\""+YrSelColor+"\"><</font></b></a><font face=\"Verdana\" color=\""+YrSelColor+"\" size=2><b> "+Cal.Year+" </b></font><a href=\"javascript:winMain.Cal.IncYear();winMain.RenderCal()\"><b><font color=\""+YrSelColor+"\">></font></b></a></td></tr></table></td>\n";    
  159.     vCalHeader+="</tr>";
  160.     //Calendar header shows Month and Year
  161.     if (ShowMonthYear)
  162.         vCalHeader+="<tr><td colspan='7'><font face='Verdana' size='2' align='center' color='"+MonthYearColor+"'><b>"+Cal.GetMonthName(ShowLongMonth)+" "+Cal.Year+"</b></font></td></tr>\n";
  163.     //Week day header
  164.     vCalHeader+="<tr bgcolor="+WeekHeadColor+">";
  165.     for (i=0;i<7;i++)
  166.     {
  167.         vCalHeader+="<td align='center'><font face='Verdana' size='2'>"+WeekDayName[i].substr(0,WeekChar)+"</font></td>";
  168.     }
  169.     vCalHeader+="</tr>";    
  170.     docCal.write(vCalHeader);
  171.  
  172.     //Calendar detail
  173.     CalDate=new Date(Cal.Year,Cal.Month);
  174.     CalDate.setDate(1);
  175.     vFirstDay=CalDate.getDay();
  176.     vCalData="<tr>";
  177.     for (i=0;i<vFirstDay;i++)
  178.     {
  179.         vCalData=vCalData+GenCell();
  180.         vDayCount=vDayCount+1;
  181.     }
  182.     for (j=1;j<=Cal.GetMonDays();j++)
  183.     {
  184.         var strCell;
  185.         vDayCount=vDayCount+1;
  186.         if ((j==dtToday.getDate())&&(Cal.Month==dtToday.getMonth())&&(Cal.Year==dtToday.getFullYear()))
  187.             strCell=GenCell(j,true,TodayColor);//Highlight today's date
  188.         else
  189.         {
  190.             if (j==Cal.Date)
  191.             {
  192.                 strCell=GenCell(j,true,SelDateColor);
  193.             }
  194.             else
  195.             {     
  196.                 if (vDayCount%7==0)
  197.                     strCell=GenCell(j,false,SaturdayColor);
  198.                 else if ((vDayCount+6)%7==0)
  199.                     strCell=GenCell(j,false,SundayColor);
  200.                 else
  201.                     strCell=GenCell(j,null,WeekDayColor);
  202.             }        
  203.         }                        
  204.         vCalData=vCalData+strCell;
  205.  
  206.         if((vDayCount%7==0)&&(j<Cal.GetMonDays()))
  207.         {
  208.             vCalData=vCalData+"</tr>\n<tr>";
  209.         }
  210.     }
  211.     docCal.writeln(vCalData);    
  212.     //Time picker
  213.     if (Cal.ShowTime)
  214.     {
  215.         var showHour;
  216.         showHour=Cal.getShowHour();        
  217.         vCalTime="<tr>\n<td colspan='7' align='center'>";
  218.         vCalTime+="<input type='text' name='hour' maxlength=2 size=1 style=\"WIDTH: 22px\" value="+showHour+" onchange=\"javascript:winMain.Cal.SetHour(this.value)\">";
  219.         vCalTime+=" : ";
  220.         vCalTime+="<input type='text' name='minute' maxlength=2 size=1 style=\"WIDTH: 22px\" value="+Cal.Minutes+" onchange=\"javascript:winMain.Cal.SetMinute(this.value)\">";
  221.         vCalTime+=" : ";
  222.         vCalTime+="<input type='text' name='second' maxlength=2 size=1 style=\"WIDTH: 22px\" value="+Cal.Seconds+" onchange=\"javascript:winMain.Cal.SetSecond(this.value)\">";
  223.         if (TimeMode==12)
  224.         {
  225.             var SelectAm =(parseInt(Cal.Hours,10)<12)? "Selected":"";
  226.             var SelectPm =(parseInt(Cal.Hours,10)>=12)? "Selected":"";
  227.  
  228.             vCalTime+="<select name=\"ampm\" onchange=\"javascript:winMain.Cal.SetAmPm(this.options[this.selectedIndex].value);\">";
  229.             vCalTime+="<option "+SelectAm+" value=\"AM\">AM</option>";
  230.             vCalTime+="<option "+SelectPm+" value=\"PM\">PM<option>";
  231.             vCalTime+="</select>";
  232.         }    
  233.         vCalTime+="\n</td>\n</tr>";
  234.         docCal.write(vCalTime);
  235.     }    
  236.     //end time picker
  237.     docCal.writeln("\n</table>");
  238.     docCal.writeln("</form></body></html>");
  239.     docCal.close();
  240. }
  241.  
  242. function GenCell(pValue,pHighLight,pColor)//Generate table cell with value
  243. {
  244.     var PValue;
  245.     var PCellStr;
  246.     var vColor;
  247.     var vHLstr1;//HighLight string
  248.     var vHlstr2;
  249.     var vTimeStr;
  250.  
  251.     if (pValue==null)
  252.         PValue="";
  253.     else
  254.         PValue=pValue;
  255.  
  256.     if (pColor!=null)
  257.         vColor="bgcolor=\""+pColor+"\"";
  258.     else
  259.         vColor="";    
  260.     if ((pHighLight!=null)&&(pHighLight))
  261.         {vHLstr1="color='red'><b>";vHLstr2="</b>";}
  262.     else
  263.         {vHLstr1=">";vHLstr2="";}    
  264.  
  265.     if (Cal.ShowTime)
  266.     {
  267.         vTimeStr="winMain.document.getElementById('"+Cal.Ctrl+"').value+=' '+"+"winMain.Cal.getShowHour()"+"+':'+"+"winMain.Cal.Minutes"+"+':'+"+"winMain.Cal.Seconds";
  268.         if (TimeMode==12)
  269.             vTimeStr+="+' '+winMain.Cal.AMorPM";
  270.     }    
  271.     else
  272.         vTimeStr="";        
  273.     PCellStr="<td "+vColor+" width="+CellWidth+" align='center'><font face='verdana' size='2'"+vHLstr1+"<a href=\"javascript:winMain.document.getElementById('"+Cal.Ctrl+"').value='"+Cal.FormatDate(PValue)+"';"+vTimeStr+";window.close();\">"+PValue+"</a>"+vHLstr2+"</font></td>";
  274.     var myDate=Cal.FormatDate(PValue);
  275.     return PCellStr;
  276. }
  277.  
  278. function Calendar(pDate,pCtrl)
  279. {    
  280.     //Properties
  281.     this.Date=pDate.getDate();//selected date
  282.     this.Month=pDate.getMonth();//selected month number
  283.     this.Year=pDate.getFullYear();//selected year in 4 digits
  284.     this.Hours=pDate.getHours();    
  285.  
  286.     if (pDate.getMinutes()<10)
  287.         this.Minutes="0"+pDate.getMinutes();
  288.     else
  289.         this.Minutes=pDate.getMinutes();
  290.  
  291.     if (pDate.getSeconds()<10)
  292.         this.Seconds="0"+pDate.getSeconds();
  293.     else        
  294.         this.Seconds=pDate.getSeconds();
  295.  
  296.     this.MyWindow=winCal;
  297.     this.Ctrl=pCtrl;
  298.     this.Format="ddMMyyyy";
  299.     this.Separator=DateSeparator;
  300.     this.ShowTime=false;
  301.     if (pDate.getHours()<12)
  302.         this.AMorPM="AM";
  303.     else
  304.         this.AMorPM="PM";    
  305. }
  306.  
  307. function GetMonthIndex(shortMonthName)
  308. {
  309.     for (i=0;i<12;i++)
  310.     {
  311.         if (MonthName[i].substring(0,3).toUpperCase()==shortMonthName.toUpperCase())
  312.         {    return i;}
  313.     }
  314. }
  315. Calendar.prototype.GetMonthIndex=GetMonthIndex;
  316.  
  317. function IncYear()
  318. {    Cal.Year++;}
  319. Calendar.prototype.IncYear=IncYear;
  320.  
  321. function DecYear()
  322. {    Cal.Year--;}
  323. Calendar.prototype.DecYear=DecYear;
  324.  
  325. function SwitchMth(intMth)
  326. {    Cal.Month=intMth;}
  327. Calendar.prototype.SwitchMth=SwitchMth;
  328.  
  329. function SetHour(intHour)
  330. {    
  331.     var MaxHour;
  332.     var MinHour;
  333.     if (TimeMode==24)
  334.     {    MaxHour=23;MinHour=0}
  335.     else if (TimeMode==12)
  336.     {    MaxHour=12;MinHour=1}
  337.     else
  338.         alert("TimeMode can only be 12 or 24");        
  339.     var HourExp=new RegExp("^\\d\\d$");
  340.     if (HourExp.test(intHour) && (parseInt(intHour,10)<=MaxHour) && (parseInt(intHour,10)>=MinHour))
  341.     {    
  342.         if ((TimeMode==12) && (Cal.AMorPM=="PM"))
  343.         {
  344.             if (parseInt(intHour,10)==12)
  345.                 Cal.Hours=12;
  346.             else    
  347.                 Cal.Hours=parseInt(intHour,10)+12;
  348.         }    
  349.         else if ((TimeMode==12) && (Cal.AMorPM=="AM"))
  350.         {
  351.             if (intHour==12)
  352.                 intHour-=12;
  353.             Cal.Hours=parseInt(intHour,10);
  354.         }
  355.         else if (TimeMode==24)
  356.             Cal.Hours=parseInt(intHour,10);    
  357.     }
  358. }
  359. Calendar.prototype.SetHour=SetHour;
  360.  
  361. function SetMinute(intMin)
  362. {
  363.     var MinExp=new RegExp("^\\d\\d$");
  364.     if (MinExp.test(intMin) && (intMin<60))
  365.         Cal.Minutes=intMin;
  366. }
  367. Calendar.prototype.SetMinute=SetMinute;
  368.  
  369. function SetSecond(intSec)
  370. {    
  371.     var SecExp=new RegExp("^\\d\\d$");
  372.     if (SecExp.test(intSec) && (intSec<60))
  373.         Cal.Seconds=intSec;
  374. }
  375. Calendar.prototype.SetSecond=SetSecond;
  376.  
  377. function SetAmPm(pvalue)
  378. {
  379.     this.AMorPM=pvalue;
  380.     if (pvalue=="PM")
  381.     {
  382.         this.Hours=(parseInt(this.Hours,10))+12;
  383.         if (this.Hours==24)
  384.             this.Hours=12;
  385.     }    
  386.     else if (pvalue=="AM")
  387.         this.Hours-=12;    
  388. }
  389. Calendar.prototype.SetAmPm=SetAmPm;
  390.  
  391. function getShowHour()
  392. {
  393.     var finalHour;
  394.     if (TimeMode==12)
  395.     {
  396.         if (parseInt(this.Hours,10)==0)
  397.         {
  398.             this.AMorPM="AM";
  399.             finalHour=parseInt(this.Hours,10)+12;    
  400.         }
  401.         else if (parseInt(this.Hours,10)==12)
  402.         {
  403.             this.AMorPM="PM";
  404.             finalHour=12;
  405.         }        
  406.         else if (this.Hours>12)
  407.         {
  408.             this.AMorPM="PM";
  409.             if ((this.Hours-12)<10)
  410.                 finalHour="0"+((parseInt(this.Hours,10))-12);
  411.             else
  412.                 finalHour=parseInt(this.Hours,10)-12;    
  413.         }
  414.         else
  415.         {
  416.             this.AMorPM="AM";
  417.             if (this.Hours<10)
  418.                 finalHour="0"+parseInt(this.Hours,10);
  419.             else
  420.                 finalHour=this.Hours;    
  421.         }
  422.     }
  423.     else if (TimeMode==24)
  424.     {
  425.         if (this.Hours<10)
  426.             finalHour="0"+parseInt(this.Hours,10);
  427.         else    
  428.             finalHour=this.Hours;
  429.     }    
  430.     return finalHour;    
  431. }                
  432. Calendar.prototype.getShowHour=getShowHour;        
  433.  
  434. function GetMonthName(IsLong)
  435. {
  436.     var Month=MonthName[this.Month];
  437.     if (IsLong)
  438.         return Month;
  439.     else
  440.         return Month.substr(0,3);
  441. }
  442. Calendar.prototype.GetMonthName=GetMonthName;
  443.  
  444. function GetMonDays()//Get number of days in a month
  445. {
  446.     var DaysInMonth=[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
  447.     if (this.IsLeapYear())
  448.     {
  449.         DaysInMonth[1]=29;
  450.     }    
  451.     return DaysInMonth[this.Month];    
  452. }
  453. Calendar.prototype.GetMonDays=GetMonDays;
  454.  
  455. function IsLeapYear()
  456. {
  457.     if ((this.Year%4)==0)
  458.     {
  459.         if ((this.Year%100==0) && (this.Year%400)!=0)
  460.         {
  461.             return false;
  462.         }
  463.         else
  464.         {
  465.             return true;
  466.         }
  467.     }
  468.     else
  469.     {
  470.         return false;
  471.     }
  472. }
  473. Calendar.prototype.IsLeapYear=IsLeapYear;
  474.  
  475. function FormatDate(pDate)
  476. {
  477.     if (this.Format.toUpperCase()=="DDMMYYYY")
  478.         return (pDate+DateSeparator+(this.Month+1)+DateSeparator+this.Year);
  479.     else if (this.Format.toUpperCase()=="DDMMMYYYY")
  480.         return (pDate+DateSeparator+this.GetMonthName(false)+DateSeparator+this.Year);
  481.     else if (this.Format.toUpperCase()=="MMDDYYYY")
  482.         return ((this.Month+1)+DateSeparator+pDate+DateSeparator+this.Year);
  483.     else if (this.Format.toUpperCase()=="MMMDDYYYY")
  484.         return (this.GetMonthName(false)+DateSeparator+pDate+DateSeparator+this.Year);    
  485.  
  486. }
  487. Calendar.prototype.FormatDate=For
matDate;
Dec 15 '08 #1
Share this Question
Share on Google+
11 Replies


acoder
Expert Mod 15k+
P: 16,027
Can you show the code of the text field in question.
Dec 15 '08 #2

clain
P: 79
i think there is multiple posting .... or there should be some function or event that triggers before actual posting is done..... which changes the text value
Dec 16 '08 #3

100+
P: 106
Expand|Select|Wrap|Line Numbers
  1. while($row=mysql_fetch_array($query))
  2.                    {     $shipping_date=$row[shipping_date];
  3.  
  4. <td><input type="text" id="demo<?echo$count?>" name="date[]" value="<?=$shipping_date?>" disabled="disabled"><a href="javascript:NewCal('demo<?echo$count?>','ddmmyyyy')"><img src="/images/cal.gif" width="16" height="16" border="0" alt="Pick a date"></a></td>
  5.  
  6.               }
the text field is first shown as disabled with the shipping date 00-00-0000 then upon making a select it chages into enabled through Js.
anyway, thats not the problem ...the problem is when its enabled and i click on the calendar icon and opens a popup i choose the date and it's successfully added to the Enabled text field But seems its not actually added !!
Dec 16 '08 #4

100+
P: 106
@clain

Yes, Can u plz show me an example of how to do That ?!
Dec 17 '08 #5

acoder
Expert Mod 15k+
P: 16,027
When the text box is enabled and the value is set, check the value in the DOM in your debugger, e.g. Firebug.
Dec 17 '08 #6

hsriat
Expert 100+
P: 1,654
If you can see the value of new date before you click submit, then I think, may be you are doing some validation onclick of the submit button which is messing up the values in the input.

Or just check on the PHP end what is being posted by the form.
Add <?php print_r($_POST) ?> in the beginning of your php of the target page.
Dec 17 '08 #7

100+
P: 106
Yes, I can see the Value of the new Date before i click Submit ... but only i can see it in the text field ...but when i click ViewSource to check if the date was in the text field value But it's not !!
Expand|Select|Wrap|Line Numbers
  1. value=""
im not doing anything on the Submit and not using onclick !!
i tried to contact the author but seems he is no longer in the field of programming :D
how lucky i am
Dec 18 '08 #8

100+
P: 106
Thanks People for your Help
seems the problem was in the DB field !!
it was set to DATE and the sql date format yyyy-mm-dd while the date fetched from the calendar was dd-mm-yyyy so i changed it to VARCHAR and the problem was solved But after i Lost some of my Hair
Dec 18 '08 #9

acoder
Expert Mod 15k+
P: 16,027
Glad you solved your problem and thanks for posting the solution. It may have been a good idea to keep the date type and changed the input to match the type because DATE is a lot more useful than VARCHAR.
Dec 18 '08 #10

hsriat
Expert 100+
P: 1,654
@jessy
:D
get some minoxidil..
Anyhow, glad to know you solved it, and I think you need to install some debuggers like firebug or web development toolbar for Firefox. They may help you to reach the solution easily.
Dec 20 '08 #11

P: 1
Use another plugin datetimepicker
Nov 19 '13 #12

Post your reply

Sign in to post your reply or Sign up for a free account.