Javascript Calendar (Not Retaining Date)

I have tried inserting an <input…> into the HTML, adding a Notes field with same name as dataarea, etc… The calendar appears, lets you select date, places in some field BUT is not retained once the form is saved and re-opened. Also, I am getting error references on the server console… acts like the JS, CSS, image files cannot br found yet all are in file/image resources. The JS scripts are actually in 2 places (script libraries and file resources). What is happening? Here is the HTMLHead content + the JS used:

	 <META http-equiv=content-type content="text/html; charset=windows-1251">

	 <script language="JavaScript" src="GurtCalendar.js"></script>

	 <script language="JavaScript" src="GurtCalendarTemplates.js"></script>

	 <script language="JavaScript" src="GurtCalendarAppearance.js"></script>

	 <link rel="stylesheet" href="main.css">		 

	 <link rel="stylesheet" href="GurtCalendar.css">

note: I have tried importing an HTML file, placing just the part in the table/cell. Again, the big issue is keeping the data intact. I’m confused about the relationship between dataarea and having a Notes field to hold data or if it is even needed.

	 		 <td align="left">

	 		 		 <img src="spacer.gif" alt="" width="20" height="1" border="0">

	 		 </td>

	 		 <td align="left" class=cl1 width="100%" valign="top">

	 		 		 

	 		 		 <table cellpadding="0" cellpadding="0" border="0">

	 		 		 		 		 <td valign="top">

	 		 		 		 		 		

	 		 		 		 		 </td>

	 		 		 		 		 <td>&nbsp;</td>

	 		 		 		 		 <td align="left" valign="top" width="200">



	 		 		 		 		 		 <script language="JavaScript">

	 		 		 		 		 		 <!--

	 		 		 		 		 		 		 var gCalendarGfg2 = {

	 		 		 		 		 		 		 		 CalendarLocalization: GCL_bs, 

	 		 		 		 		 		 		 		 CalendarTemplates : GCT_bs, 

	 		 		 		 		 		 		 		 CalendarAppearance: GCA_bs,

	 		 		 		 		 		 		 		 GeneralFormat : '%m/%d/%Y',

   MinDate :  '10/16/2006',

DataArea : ‘begindate’

  		 	 		 		 		 		 		 }

	 		 		 		 		 		 		 new gCalendar(gCalendarGfg2);

	 		 		 		 		 		 //-->

	 		 		 		 		 		 </script>

	 		 		 		 		 </td>

	 		 		 		 </tr>

	 		 		 </table>		 		 		



	 		 </td>

	 </tr>

Subject: Javascript Calendar (Not Retaining Date)

For starters, try losing the file resource versions of the scripts. Lets simplify everything. Add the .css files as file resources and paste the scripts into script libraries with the same names as the files you are currently using.Next, on the form, click the JS Header and insert the javascript libraries (right click the js header and choose the option to insert a resource to do this.

At the top of the form, insert the css by using Create…Resource…Insert Resource, then choosing style sheet and add your style sheets. This will simplify things in your htmlhead and remove any possibilities of bugs cropping up here.

Now, on to the code itself: I haven’t used this particular library, but the syntax looks similar enough to the one that I use so it should be the same. Don’t use the fields. Create your editable notes field and on the last tab, give it an id. Refer to that ID in DataArea.

Also, just at a glance, it appears the syntax here is incorrect. There is no close bracket and the call to create the object shouldn’t be inside it if there were one.

I’d recommend copying an example from the website that had the widget, then tearing it apart in a text editor and seeing what each component does and how it works. Most of these components come with fairly detailed explainations by the author.

Subject: RE: Javascript Calendar (Not Retaining Date)

Thanks Joel… you always provide great answers! Stick with me… :slight_smile: I will try asap…

Subject: RE: Javascript Calendar (Not Retaining Date)

FYI… your instructions were right on! The issue now… a mystery input field that appears only when the document is viewed in read mode on the web. It shows the Notes field -w- the start date + the input field below and a spot where the calendar icon is supposed to be (was there when creating!?!). If I go into edit mode, it disappears. Must be something in the JS script libraries. It cannot be the 5-6 lines of passthru. Will send not to vendor…

update: I am missing some formatting… makes me wonder about the CSS. Is it supposed to be a stylesheet or file resource? …assuming a SS resource.