in a support ticket, we discovere the problem was being caused when using Dynamic Drop Downs on a template.
The Create Dydnamic array behavior was being created inside the Title editabdel region:
<!-- InstanceBeginEditable name="doctitle" -->
<title>Page Name - <?php echo($WAGLOBAL_Site_Name); ?></title>
<?php
if ($row_Recordset1) {
echo "<SC" . "RIPT>\n";
echo "var WAJA = new Array();\n";
$oldmainid = 0;
$newmainid = $row_Recordset1["ProductID"];
if ($oldmainid == $newmainid) {
$oldmainid = "";
}
$n = 0;
while ($row_Recordset1) {
if ($oldmainid != $newmainid) {
echo "WAJA[".$n."] = new Array();\n";
echo "WAJA[".$n."][0] = '".WA_DD_Replace($newmainid)."';\n";
$m = 1;
}
echo "WAJA[".$n."][".$m."] = new Array();\n";
echo "WAJA[".$n."][".$m."][0] = "."'".WA_DD_Replace($row_Recordset1["ProductID"])."'".";\n";
echo "WAJA[".$n."][".$m."][1] = "."'".WA_DD_Replace($row_Recordset1["ProductID"])."'".";\n";
$m++;
if ($oldmainid == 0) {
$oldmainid = $newmainid;
}
$oldmainid = $newmainid;
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if ($row_Recordset1) {
$newmainid = $row_Recordset1["ProductID"];
}
if ($oldmainid != $newmainid) {
$n++;
}
}
echo "var Recordset1_WAJA = WAJA;\n";
echo "WAJA = null;\n";
echo "</SC" . "RIPT>\n";
}
function WA_DD_Replace($startStr) {
$startStr = str_replace("'", "|WA|", $startStr);
$startStr = str_replace("\\", "\\\\", $startStr);
$startStr = preg_replace("/[\r\n]{1,}/", " ", $startStr);
return $startStr;
}
?>
<!-- InstanceEndEditable -->
the work around to the problem we discovered was to move the Create Duynamic array code to be before the doctype tag:
<?php
if ($row_Recordset1) {
echo "<SC" . "RIPT>\n";
echo "var WAJA = new Array();\n";
$oldmainid = 0;
$newmainid = $row_Recordset1["ProductID"];
if ($oldmainid == $newmainid) {
$oldmainid = "";
}
$n = 0;
while ($row_Recordset1) {
if ($oldmainid != $newmainid) {
echo "WAJA[".$n."] = new Array();\n";
echo "WAJA[".$n."][0] = '".WA_DD_Replace($newmainid)."';\n";
$m = 1;
}
echo "WAJA[".$n."][".$m."] = new Array();\n";
echo "WAJA[".$n."][".$m."][0] = "."'".WA_DD_Replace($row_Recordset1["ProductID"])."'".";\n";
echo "WAJA[".$n."][".$m."][1] = "."'".WA_DD_Replace($row_Recordset1["ProductID"])."'".";\n";
$m++;
if ($oldmainid == 0) {
$oldmainid = $newmainid;
}
$oldmainid = $newmainid;
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if ($row_Recordset1) {
$newmainid = $row_Recordset1["ProductID"];
}
if ($oldmainid != $newmainid) {
$n++;
}
}
echo "var Recordset1_WAJA = WAJA;\n";
echo "WAJA = null;\n";
echo "</SC" . "RIPT>\n";
}
function WA_DD_Replace($startStr) {
$startStr = str_replace("'", "|WA|", $startStr);
$startStr = str_replace("\\", "\\\\", $startStr);
$startStr = preg_replace("/[\r\n]{1,}/", " ", $startStr);
return $startStr;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
then once you where finished getting dynamic drop downs to work, move it back to the original location.