/********************************************************************* Notice You may not modify, use, copy or distribute this file or its contents. Internal interfaces referenced in this file are nonpublic, unsupported and subject to change without notice. These interfaces may not be utilized in other software applications or components. *********************************************************************/ // ============================================================ \\ // form_edit.js \\ // ------------ \\ // This file contains functions that override what is comtained \\ // in form.js, that allow form preview and layout changes. \\ // ============================================================ \\ FieldContainer.prototype.displayFields = function() { var strDivName = "divFieldsContainer"; if (this.IsHeading) strDivName = "divHeadingFieldsContainer"; var FieldsHTML = getFields(this); var objDivFieldContainer = document.getElementById(strDivName); if (objDivFieldContainer != null) objDivFieldContainer.innerHTML = FieldsHTML; } function getFieldCellHTML(i_FormObject, i_objContainer) { var FieldCellHTML = ""; if (i_FormObject != null) { if (i_FormObject.Type == FormObjectType_TabGroup) { var StyleAttribute = ""; if (i_FormObject.IsHidden) StyleAttribute = " STYLE=\"display:none;\""; var FieldBodyHTML = ""; if (i_FormObject.Tabs.length > 1) { FieldBodyHTML += ""; } FieldBodyHTML += "
"; for (var i = 0; i < i_FormObject.Tabs.length; i++) { var Tab = i_FormObject.Tabs[i]; var ClassAttribute = " CLASS=\""; if (i_FormObject.ActiveTabName == Tab.Name || (i == 0 && i_FormObject.ActiveTabName == "")) { i_FormObject.ActiveTabName = Tab.Name; ClassAttribute += "activeTab"; } else ClassAttribute += "inactiveTab"; FieldBodyHTML += "" + Tab.Text + ""; } FieldBodyHTML += "
"; for (var i = 0; i < i_FormObject.Tabs.length; i++) { var Tab = i_FormObject.Tabs[i]; var StyleAttribute = " STYLE=\"display:none; width:100%;\""; if (i_FormObject.ActiveTabName == Tab.Name || (i == 0 && i_FormObject.ActiveTabName == "")) StyleAttribute = " STYLE=\"width:100%;\""; var LayoutScript = ""; if (i_FormObject.Tabs.length == 1) LayoutScript = " ONCLICK=\"selectTab(obj" + Tab.Name + ", obj" + i_FormObject.Name + ")\" ONMOUSEOVER=\"hoverTab(obj" + Tab.Name + ", obj" + i_FormObject.Name + ")\""; FieldBodyHTML += "
"; FieldBodyHTML += getTableHTML(Tab); FieldBodyHTML += "
"; } FieldBodyHTML += "
"; // The CLASS attribute for the TD tag. var ClassAttribute = ""; if (i_FormObject.ClassName != "") ClassAttribute = " CLASS=\"" + i_FormObject.ClassName + "\""; // The ONCLICK attribute for the TD tags. var OnClickAttribute = " ONCLICK=\"if (typeof obj" + i_FormObject.Name + " != 'undefined') { selectField(obj" + i_FormObject.Name + "); }\""; var OnMouseOverAttribute = " ONMOUSEOVER=\"if (typeof obj" + i_FormObject.Name + " != 'undefined') { hoverField(obj" + i_FormObject.Name + "); }\""; // The TITLE attribute for the TD tags. var TitleAttribute = " TITLE=\"Click to select this field: " + i_FormObject.Name + "\""; // The common attributes for label and field TD tags. var LabelAttributes = " VALIGN=\"top\" STYLE=\"cursor:hand;\"" + OnClickAttribute + OnMouseOverAttribute + " ID=\"" + i_FormObject.Name + "_label\"" + ClassAttribute + TitleAttribute; var FieldAttributes = " VALIGN=\"top\" STYLE=\"cursor:hand;\"" + OnClickAttribute + OnMouseOverAttribute + " ID=\"" + i_FormObject.Name + "_field\"" + ClassAttribute + TitleAttribute; // The COLSPAN attribute for the TD tag. var ColumnSpan = getSpanAttribute("COLSPAN", i_FormObject.ColumnSpan * 2); var RowSpan = getSpanAttribute("ROWSPAN", i_FormObject.RowSpan); // The COLSPAN attribute for the TD tag. var FieldColumnSpan = getSpanAttribute("COLSPAN", (i_FormObject.ColumnSpan * 2) - 1); // The FONT tag containing the field label. var FieldLabel = "" + getFieldLabel(i_FormObject) + ""; switch (i_FormObject.LabelPosition) { case "Right": FieldCellHTML += "" + FieldBodyHTML + ""; FieldCellHTML += "" + FieldLabel + ""; break; case "Top": var LineBreak = "
"; if (getFieldLabel(i_FormObject).indexOf("= 0) LineBreak = ""; FieldCellHTML += "" + ((getFieldLabel(i_FormObject) != "") ? FieldLabel + LineBreak : "") + FieldBodyHTML + ""; break; default: FieldCellHTML += "" + FieldLabel + ""; FieldCellHTML += "" + FieldBodyHTML + ""; break; } } else { // Get the body HTML for the field. var FieldBodyHTML = ""; if (i_FormObject.Type == FormObjectType_FieldGroup) FieldBodyHTML = getFieldGroupBody(i_FormObject, true); else FieldBodyHTML = i_FormObject.getBody(); // The STYLE attribute for TD tags. var FieldStyleAttribute = ""; var LabelStyleAttribute = ""; // Hide fields that should be hidden. if (i_FormObject.IsHidden) { FieldStyleAttribute += " STYLE=\"display:none;\""; LabelStyleAttribute += " STYLE=\"display:none;\""; } // The CLASS attribute for the TD tags. var ClassAttribute = ""; if (i_FormObject.ClassName != "") ClassAttribute = " CLASS=\"" + i_FormObject.ClassName + "\""; // None of these properties apply to form heading fields. var OnClickAttribute = ""; var OnMouseOverAttribute = ""; var TitleAttribute = ""; var LabelAttributes = " VALIGN=\"top\""; var FieldAttributes = " VALIGN=\"top\""; var ColumnSpan = ""; var RowSpan = getSpanAttribute("ROWSPAN", i_FormObject.RowSpan); // If it is not a form heading field, set appropriate attributes. if (!i_objContainer.IsHeading) { // The ONCLICK attribute for the TD tags. OnClickAttribute = " ONCLICK=\"if (typeof obj" + i_FormObject.Name + " != 'undefined') { selectField(obj" + i_FormObject.Name + "); }\""; OnMouseOverAttribute = " ONMOUSEOVER=\"if (typeof obj" + i_FormObject.Name + " != 'undefined') { hoverField(obj" + i_FormObject.Name + "); }\""; // The TITLE attribute for the TD tags. TitleAttribute = " TITLE=\"Click to select this field: " + i_FormObject.Name + "\""; // The common attributes for label and field TD tags. var LabelAttributes = " VALIGN=\"top\" STYLE=\"cursor:hand;\"" + OnClickAttribute + OnMouseOverAttribute + " ID=\"" + i_FormObject.Name + "_label\"" + ClassAttribute + TitleAttribute; var FieldAttributes = " VALIGN=\"top\" STYLE=\"cursor:hand;\"" + OnClickAttribute + OnMouseOverAttribute + " ID=\"" + i_FormObject.Name + "_field\"" + ClassAttribute + TitleAttribute; // The COLSPAN attribute for the TD tag. var ColumnSpan = getSpanAttribute("COLSPAN", i_FormObject.ColumnSpan * 2); } if (i_FormObject instanceof Static) { var AlignAttribute = ""; if (i_FormObject.Center) AlignAttribute = " ALIGN=\"center\""; FieldCellHTML += "" + FieldBodyHTML + ""; } else { // The COLSPAN attribute for the TD tag. var FieldColumnSpan = getSpanAttribute("COLSPAN", (i_FormObject.ColumnSpan * 2) - 1); // The FONT tag containing the field label. var FieldLabel = "" + getFieldLabel(i_FormObject) + i_FormObject.getRequired() + ""; switch (i_FormObject.LabelPosition) { case "Right": FieldCellHTML += "" + FieldBodyHTML + ""; FieldCellHTML += "" + FieldLabel + ""; break; case "Top": var LineBreak = "
"; if (getFieldLabel(i_FormObject).indexOf("= 0) LineBreak = ""; FieldCellHTML += "" + ((getFieldLabel(i_FormObject) != "" || i_FormObject.getRequired() != "") ? FieldLabel + LineBreak : "") + FieldBodyHTML + ""; break; default: FieldCellHTML += "" + FieldLabel + ""; FieldCellHTML += "" + FieldBodyHTML + ""; break; } } } } else { FieldCellHTML += ""; } return FieldCellHTML; }