#1174: support HTML fields in the bulk modify forms (capability to enable/disable the field live)

SVN:trunk[3883]
This commit is contained in:
Denis Flaven
2016-01-26 14:32:51 +00:00
parent ef6299c6b4
commit 172e255cc2
4 changed files with 31 additions and 16 deletions

View File

@@ -233,25 +233,32 @@ function ValidateCKEditField(sFieldId, sPattern, bMandatory, sFormId, nullValue)
var bValid;
var sTextContent;
// Get the contents without the tags
var oFormattedContents = $("#cke_"+sFieldId+" iframe");
if (oFormattedContents.length == 0)
if ($('#'+sFieldId).attr('disabled'))
{
var oSourceContents = $("#cke_"+sFieldId+" textarea.cke_source");
sTextContent = oSourceContents.val();
bValid = true; // disabled fields are not checked
}
else
{
sTextContent = oFormattedContents.contents().find("body").text();
}
if (bMandatory && (sTextContent == ''))
{
bValid = false;
}
else
{
bValid = true;
// Get the contents without the tags
var oFormattedContents = $("#cke_"+sFieldId+" iframe");
if (oFormattedContents.length == 0)
{
var oSourceContents = $("#cke_"+sFieldId+" textarea.cke_source");
sTextContent = oSourceContents.val();
}
else
{
sTextContent = oFormattedContents.contents().find("body").text();
}
if (bMandatory && (sTextContent == ''))
{
bValid = false;
}
else
{
bValid = true;
}
}
ReportFieldValidationStatus(sFieldId, sFormId, bValid, '');