Okay so I solved the problem. The build doesn't include jquery in the code. I found this:
www.j-cook.pro/forum/32-trouble-shooting...lem-with-date-picker
which helped. I found I needed to add explicitly the two lines:
$doc->addScript($componentUrlAdmin . '/js/jquery-1.8.2.min.js');
$doc->addScript($componentUrlAdmin . '/js/jquery-ui-1.9.1.min.js');
in the
function headerDeclarations()
so the top of it now looks like this
function headerDeclarations()
{
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$siteUrl = JURI::root(true);
$siteUrl = str_replace("\\", "/", $siteUrl); //Win servers
$componentUrl = $siteUrl . '/components/com_customersitedetails';
$componentUrlAdmin = $siteUrl .'/administrator/components/com_customersitedetails';
$doc->addScript($componentUrlAdmin . '/js/jquery-1.8.2.min.js');
$doc->addScript($componentUrlAdmin . '/js/jquery-ui-1.9.1.min.js');
//Javascript
$doc->addScript($siteUrl . '/media/system/js/core.js');
// Mootools non conflict is handled here :
$doc->addScriptDeclaration("var Moo = document.id;");
This happens even when I use the option to include jquery in the build system.
Hope this helps someone with a problem.