• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

calender

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My application has a calender in it to select the date.I have created some validations for calender which works fine , but i want this calender should not select the previous date. can some one suggest me what extra line do i need to add in the following code:-


for (i=0; i<startDay; i++, column++)
output += '<TD WIDTH=50 HEIGHT=30><FONT SIZE=-2 COLOR="#808080" FACE="ARIAL">' + (days[lastMonth]-startDay+i+1) + '<\/FONT><\/TD>';

for (i=1; i<=days[Month]; i++, column++) {
if(column == 0){
output += '<TD WIDTH=50 HEIGHT=30>' + '<FONT SIZE=-2 FACE="ARIAL" COLOR="#808080">' + i + '<\/FONT>' +'<\/TD>';
}else if (column == 6) {
output += '<TD WIDTH=50 HEIGHT=30>' + '<FONT SIZE=-2 FACE="ARIAL" COLOR="#808080">' + i + '<\/FONT>' +'<\/TD>';
output += '<\/TR><TR ALIGN=CENTER VALIGN=MIDDLE>';
column = -1;
}else if ( i > maxDate) {
output += '<TD WIDTH=50 HEIGHT=30>' + '<FONT SIZE=-2 FACE="ARIAL" COLOR="#808080">' + i + '<\/FONT>' +'<\/TD>';
}else if ( i == opener.day ) {
output += '<TD WIDTH=50 HEIGHT=30>' + '<A HREF="javascript:changeDay(' + i + ')"><FONT SIZE=-1 FACE="ARIAL" COLOR="#FF0000"><B>' + i + '<\/B><\/FONT><\/A>' +'<\/TD>';
} else {
output += '<TD WIDTH=50 HEIGHT=30>' + '<A HREF="javascript:changeDay(' + i + ')"><FONT SIZE=-2 FACE="ARIAL" COLOR="#0000FF">' + i + '<\/FONT><\/A>' +'<\/TD>';
}
}

if (column > 0) {
for (i=1; column<7; i++, column++)
output += '<TD WIDTH=50 HEIGHT=30><FONT SIZE=-2 COLOR="#808080" FACE="ARIAL">' + i + '<\/FONT><\/TD>';
}

output += '<\/TR><\/TABLE><\/FORM><\/TD><\/TR><\/TABLE>';

return output;
}
 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am so buddy but i could not see any validations in your code. it looked more like a drawing code and not a validating code.
anyway, you know what today is.
Whenever the user selects another date, just compare if the date selected is less than todays date and if so then do what you want.
Correct me if i have not understood your question.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic