473,395 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

help with garden calendar

I'm trying to make a calendar where the frost date is input and based on this date, a list of other dates are calculated that will be specific times from the input date. I have minimal programming skills and would appreciate any help.

I've gotten code that will input the frost date and output a single date (6 weeks prior to this date = tomato planting date). I wish the output button was a list of dates, or there were multiple buttons that pop up..... Maybe someone could help with adding one more date line and I can figure out how to repeat. Or direct me to the function I need to research more. Thanks!

test site: http://bioarray.us/generate%20planti...=5&d1=20&m1=10

code so far:
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Untitled Document</title>
  6. </head>
  7.  
  8. <body>
  9.  
  10.  
  11. <form>
  12.   <p>
  13.     <input type="text" name="date1" size="20">
  14.     <br>
  15. Date of last spring frost (mm/dd/yyyy)<br>
  16. Enter month and day of the latest spring frost in your garden in the past 5 years or so. If you don't know this, use the date from <a href="http://www.burpee.com/ancillary/zonefinder.do">Burpee</a> or <a href="http://cdo.ncdc.noaa.gov/cgi-bin/climatenormals/climatenormals.pl?directive=prod_select2&prodtype=CLIM2001&subrnum">NOAA</a>. For year, enter this year - 2009.
  17. <br>
  18. <br>
  19. <input type="button" value="Generate planting calendar!"
  20. onclick="finddates(this);" />
  21.   </p>
  22.   <p>&nbsp;</p>
  23.   <p>
  24.     <input type="text" name="date2" size="20" readonly>
  25.     Sow tomato seed indoors.<br>
  26.     <br>
  27.     <br>
  28.       </p>
  29. </form>
  30.  
  31. <script type="text/javascript">
  32.  
  33. document.forms(0).date1.value = dateToString(new Date())
  34.  
  35. function dateToString(d){
  36. return [d.getMonth()+1,d.getDate()].join('/')
  37.  
  38. }
  39.  
  40. function finddates(x){
  41. d = new Date(x.form.date1.value)
  42. d = new Date(d.getYear(),d.getMonth(),d.getDate()-40)
  43. x.form.date2.value = dateToString(d)
  44.  
  45.  
  46. }
  47. </script>
  48. <br>
  49. <br>
  50. <br>
  51. <br>
  52. <br>
  53.  
  54.  
  55.  
  56. </body>
  57. </html>
  58.  
  59.  
  60. </body>
  61. </html>
Feb 5 '09 #1
10 4830
David Laakso
397 Expert 256MB
@carletongardener
Move post to appropriate board on this forum. (X)HTML/CSS does not meet need required...
Feb 6 '09 #2
Dormilich
8,658 Expert Mod 8TB
@carletongardener
you could use a couple of checkboxes to set the dates (tomato, cucumber, ...) to be computed. the checkboxes' value could be the number of days to subtract/add to the current date. this way, the function triggered by the button needs to fetch all the checked checkboxes using their passed value to compute the date.

for a better styling of the page have a look at CSS, especially the properties padding and margin should be good to start.

finally, I think you'd better use HTML than XHTML to start with
- true XHTML (with the recommended mime type "application/xhtml+xml") is not supported by Internet Explorer
- XHTML served as "text/html" is treated as HTML
- XHTML must be well-formed, otherwise browsers give you an error (the so-called Yellow Screen Of Death (YSOD))
(empty elements (like <img>, <br>, <hr>) are written <tagname/> (<img/>, <br/>, <hr/>), & must always be escaped)

regards
Feb 6 '09 #3
Thanks for the suggestions!

I'm sorry I can't figure out how to move this thread and am not even sure where it should be moved to. (embarrassing...)

I converted to HTML, I think. I'm using DreamWeaver.

New test site: http://bioarray.us/planting%20calendar%202.html

Looks nicer now. I just need get the calculator functions to generate several different dates that are different lengths fo time form input date and enter these into the appropriate boxes.

New code:
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <!-- DW6 -->
  4. <head>
  5. <!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
  6. <title>Lodging - Calendar</title>
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  8. <link rel="stylesheet" href="mm_lodging1.css" type="text/css">
  9. </head>
  10. <body bgcolor="#999966">
  11. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  12.     <tr>
  13.     <td width="15" nowrap>&nbsp;</td>
  14.     <td height="60" colspan="2" class="logo" nowrap><br>
  15.     Skippy's Vegetable Garden</td>
  16.     <td width="100%">&nbsp;</td>
  17.     </tr>
  18.  
  19.     <tr bgcolor="#ffffff">
  20.     <td colspan="4"><img src="mm_spacer.gif" alt="" width="1" height="1" border="0"></td>
  21.     </tr>
  22.  
  23.     <tr bgcolor="#a4c2c2">
  24.     <td width="15" nowrap>&nbsp;</td>
  25.     <td height="36" id="navigation" class="navText"><a href="http://www.carletongarden.blogspot.com/">HOME</a><a href="javascript:;"></a></td>
  26.     <td>&nbsp;</td>
  27.     <td width="100%">&nbsp;</td>
  28.     </tr>
  29.  
  30.     <tr bgcolor="#ffffff">
  31.     <td colspan="4"><img src="mm_spacer.gif" alt="" width="1" height="1" border="0"></td>
  32.     </tr>
  33.  
  34.     <tr bgcolor="#ffffff">
  35.     <td valign="top" width="15"><img src="mm_spacer.gif" alt="" width="15" height="1" border="0"></td>
  36.     <td valign="top" width="35"><img src="mm_spacer.gif" alt="" width="35" height="1" border="0"></td>
  37.     <td width="710" valign="top"><br>
  38.     <table border="0" cellspacing="0" cellpadding="2" width="610">
  39.         <tr>
  40.           <td class="pageName">Personalized Vegetable Garden Planting Calender</td>
  41.         </tr>
  42.     </table>
  43.     <p>Enter the date of your last srping frost (mm/dd/yyyy)
  44.     <form>
  45.   <p>
  46.     <input type="text" name="date1" size="20">
  47.     <br>
  48. Enter month and day of the latest spring frost in your garden in the past 5 years or so. If you don't know this, use the date from <a href="http://www.burpee.com/ancillary/zonefinder.do">Burpee</a> or <a href="http://cdo.ncdc.noaa.gov/cgi-bin/climatenormals/climatenormals.pl?directive=prod_select2&prodtype=CLIM2001&subrnum">NOAA</a>. For year, enter this year - 2009.
  49. <br>
  50. <br>
  51. <input type="button" value="Generate planting calendar!"
  52. onclick="finddates(this);" />
  53.   </p>
  54.   <p>&nbsp;</p>
  55.   <p>
  56.     <input type="text" name="date2" size="20" readonly>
  57.     Sow tomato seeds indoors.<br>
  58.     </p>
  59.   <p>
  60.     <input type="text" name="date3" size="20" readonly>
  61.     Sow cucumber seeds indoors.</p>
  62.   <p>
  63.     <input type="text" name="date4" size="20" readonly>
  64.     Sow sunflowers directly in the garden.</p>
  65.   <p><br>
  66.   </p>
  67.     </form>
  68.  
  69. <script type="text/javascript">
  70.  
  71. document.forms(0).date1.value = dateToString(new Date())
  72.  
  73. function dateToString(d){
  74. return [d.getMonth()+1,d.getDate()].join('/')
  75.  
  76. }
  77.  
  78. function finddates(x){
  79. d = new Date(x.form.date1.value)
  80. d = new Date(d.getYear(),d.getMonth(),d.getDate()-40)
  81. x.form.date2.value = dateToString(d)
  82.  
  83.  
  84. }
  85. </script>
  86. <br>
  87. <br>
  88. <br>
  89. <br>
  90. <br>
  91.  
  92.  
  93.  
  94. <br>
  95.      *  &nbsp;<br>
  96.       </p>
  97.      *</td>
  98.     <td>&nbsp;</td>
  99.     </tr>
  100.  
  101.     <tr>
  102.     <td width="15">&nbsp;</td>
  103.     <td width="35">&nbsp;</td>
  104.     <td width="710">&nbsp;</td>
  105.     <td width="100%">&nbsp;</td>
  106.     </tr>
  107. </table>
  108. </body>
  109. </html>
Feb 6 '09 #4
acoder
16,027 Expert Mod 8TB
Line 71 document.forms(0) should be document.forms[0].

PS. please use [code] tags when posting code.

PPS. Moved to the JavaScript forum.
Feb 11 '09 #5
Thanks SO much for the help! I'm all set. Here's the final link to my tool, if you want to generate a planting calender for your vegetable garden. http://bioarray.us/Skippy%27s%20plan...0calendar.html (Sorry I'm such a noob.)
Feb 12 '09 #6
David Laakso
397 Expert 256MB
Nice job. Validating the markup could be a nice touch. So might making it readable, for children of all ages, on landing. But these are trivial matters. Or, are they?
Feb 12 '09 #7
Thanks. I validated. Don't know how to make it readable. K
Feb 12 '09 #8
David Laakso
397 Expert 256MB
Change the body declaration to read:
Expand|Select|Wrap|Line Numbers
  1. body { 
  2. font: 100%/1.4 Helvetica, Arial, sans-serif;
  3. margin:0;padding:0;
  4. background:#fff;
  5. }
  6.  
100% is default. 1.4 is line-height.

re: sans
Completely delete each and every font-size rule throughout the style sheet and the styles embedded in the head of the document. Each will inherit default (100%) sans from the body declaration.

re:serif
Change the font-size for TNR and Georgia to 100% with a raw number (as above) for line-height if even needed. Bump either or both up a little if you like.

re: sans and serif
Users will now get their preference, rather than yours. And should users who know how to use their machine decide to go up or down in size from their default by scaling the fonts, they can do so in compliant browsers, and more easily in the IEs as well...
Feb 12 '09 #9
Thank you! I hope I did this right.
Feb 12 '09 #10
David Laakso
397 Expert 256MB
@carletongardener
So do i. Post to the forum and someone will check it...
Feb 13 '09 #11

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

Similar topics

3
by: Steve | last post by:
Hi What is difference between web farm and web garden? What i understand so far Web Farm Multi Server Environment Support Session share Application object not supported Caching not...
1
by: Dominic | last post by:
I'd like to tune the performance of my application in a web garden. Our server has dual processors. Is there any guideline to set this "maximum number of worker processes" for web garden? In my...
0
by: Parthiv Joshi | last post by:
I want to make a week view calendar control just as month view calendar control given in .NET...Do anyone know how to make it..and if anybody has the source code..kindly post it...I want to learn...
5
by: Benny | last post by:
I have a ASP.NET webservice and it is configured to run in a web garden with multiple processes. Whan a process in the garden is launched, I want the process to create a background thread. When...
2
by: TristaSD | last post by:
Hi, Here's a link to a simple php-based system I'm working on. Go ahead and play nice, nothing is validated :) http://www.basementflooded.com/reserv Currently, a calendar date is...
1
by: markclinn | last post by:
I am trying to use the calander control to pick a date and retrieve information from a database. When a date is clicked on, the page re-loads, with the selected date, gets the informatino from the...
1
by: sam1666 | last post by:
i need some help with calendar control as in need to link a booking record form to th calender, some when a selected date is click it brings up the bookings for that date of creates a new date....
5
by: Cramer | last post by:
I think I understand *what* a Web garden is (app running on a server with multiple processors). But what's the benefit? I have googled this and have found only articles that describe WHAT and HOW...
7
by: William (Tamarside) | last post by:
Please, if you have the time and knowledge to help me I'd truly appreciate it! I need to build a calendar page that displays available/unavailable info from a DB and colour a cell according to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.