mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
Fixed bug in the new portal: the wizard validation was inoperant when several selection lists were proposed
SVN:trunk[1587]
This commit is contained in:
@@ -147,9 +147,18 @@ EOF
|
|||||||
|
|
||||||
$this->add_script(
|
$this->add_script(
|
||||||
<<<EOF
|
<<<EOF
|
||||||
function CheckSelection(sMessage)
|
function CheckSelection(sMessage, sInputId)
|
||||||
{
|
{
|
||||||
var bResult = ($('input:checked').length > 0);
|
var bResult;
|
||||||
|
if (sInputId.length > 0)
|
||||||
|
{
|
||||||
|
bResult = ($('input[name='+sInputId+']:checked').length > 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// First select found...
|
||||||
|
bResult = ($('input:checked').length > 0);
|
||||||
|
}
|
||||||
if (!bResult)
|
if (!bResult)
|
||||||
{
|
{
|
||||||
alert(sMessage);
|
alert(sMessage);
|
||||||
@@ -804,12 +813,12 @@ EOF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function WizardCheckSelectionOnSubmit($sMessageIfNoSelection)
|
public function WizardCheckSelectionOnSubmit($sMessageIfNoSelection, $sInputName = '')
|
||||||
{
|
{
|
||||||
$this->add_ready_script(
|
$this->add_ready_script(
|
||||||
<<<EOF
|
<<<EOF
|
||||||
$('#{$this->m_sWizardId}').submit(function() {
|
$('#{$this->m_sWizardId}').submit(function() {
|
||||||
return CheckSelection('$sMessageIfNoSelection');
|
return CheckSelection('$sMessageIfNoSelection', '$sInputName');
|
||||||
});
|
});
|
||||||
EOF
|
EOF
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user