Tom Muck

Alpha Dog Blues Band
Home page
All articles
All Extensions | Extension News | Extension FAQs | Customer Login
Books authored or co-authored by Tom Muck
Extensions, books, and other products | Customer Login
Your current cart contents
Tom-Muck.com Blog | CMXTraneous Blog | Flash Remoting Blog
About the site

Use Calendar

Use the CW calendar script in your site

The admin section of Cartweaver contains a calendar script to fill in some fields in OrderDetails. To use this script somewhere else in your site, follow these simple instructions.

1. In /cw2/admin/ there is a file called DatePopup.php. This is the calendar functionality. You will have to make a copy of the file and put it in your site somewhere so that you can link to it.

2. There is also a gif image of the calendar at /cw2/admin/assets/images. This will need to go somewhere in your site so you can use it as well.

3. Then, next to the text box that you want to have the calendar. Put the image link and the code next to it, changing the code so that it matches your box name:

<a href="javascript:ShowCalendar('OrderStatus', 'order_ShipDate')"><img src="assets/images/calendar.gif" alt="Click to Select Date" width="16" height="16"></a>

(order_ShipDate is the field name to replace, and OrderStatus is the form name)

And a little JavaScript into the head of the file:

<script language="JavaScript">
<!--
/* Date Pop Up */
// function to load the calendar window.
function ShowCalendar(FormName, FieldName) {
var curValue = eval("document."+FormName+"."+FieldName+".value");
window.open("DatePopup.php?getDate="+ curValue + "&FormName=" + FormName + "&FieldName=" + FieldName, "CalendarWindow", "width=250,height=200");
}

//-->
</script>

Back to Cartweaver PHP FAQ, code changes, and samples

Pay me securely with your Visa, MasterCard, Discover, or American Express card through PayPal!
Pay me securely with your Visa, MasterCard, Discover, or American Express card through PayPal!
About | Privacy Policy | Contact | License Agreement | ©2002-2025 Tom Muck | Dreamweaver Extensions