mirror of
https://github.com/Combodo/iTop.git
synced 2026-08-22 22:28:19 +02:00
N°2160: Correctly initialize fields depending on a select field with only 1 value
This commit is contained in:
@@ -2178,6 +2178,11 @@ EOF
|
||||
if ((count($aAllowedValues) == 1) && ($bMandatory == 'true'))
|
||||
{
|
||||
// When there is only once choice, select it by default
|
||||
$oPage->add_ready_script(
|
||||
<<<EOF
|
||||
$('#$iId').attr('data-validate','dependencies');
|
||||
EOF
|
||||
);
|
||||
$sSelected = ' selected';
|
||||
}
|
||||
else
|
||||
|
||||
@@ -208,6 +208,11 @@ class UIExtKeyWidget
|
||||
{
|
||||
// When there is only once choice, select it by default
|
||||
$sSelected = 'selected';
|
||||
$oPage->add_ready_script(
|
||||
<<<EOF
|
||||
$('#$this->iId').attr('data-validate','dependencies');
|
||||
EOF
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -190,6 +190,7 @@ function ReportFieldValidationStatus(sFieldId, sFormId, bValid, sExplain)
|
||||
{
|
||||
// Visual feedback - none when it's Ok
|
||||
$('#v_'+sFieldId).html(''); //<img src="../images/validation_ok.png" />');
|
||||
$('#'+sFieldId+'[data-validate*="dependencies"]').trigger('change.dependencies').removeAttr('data-validate');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user