mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-28 04:58:46 +02:00
#1174 Support HTML fields in the bulk modify form (capability to disable/enable) the field live (retrofit from trunk)
SVN:2.1.0[3893]
This commit is contained in:
@@ -230,25 +230,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, '');
|
||||
|
||||
Reference in New Issue
Block a user