0
はいラジオボタンをクリックすると、チェックボックスが必要になります。チェックボックスをオンにしてはいけません。現在、両方の条件で検証しています。選択された。ここ は、それはあなたが無効にするグループを追加する行の後に来るように画像enter image description hereムードルの無効なフィールドで検証をスキップ
$confirmpreprocedure[] = $mform->createElement('radio', 'preprocedure4', '', get_string('yes','assignsubmission_ebus'), 'yes');
$confirmpreprocedure[] = $mform->createElement('radio', 'preprocedure4', '', get_string('no','assignsubmission_ebus'), 'no');
$mform->addGroup($confirmpreprocedure, 'preprocedure4', get_string('preprocedure','assignsubmission_ebus'),array(' '), false);
$mform->addRule('preprocedure4', null, 'required', null, 'client');
$mform->disabledIf('preprocedure', 'preprocedure4', 'neq', 'yes');
$preprocedure = array();
$preprocedure[] = $mform->createElement('advcheckbox','preprocedure1',get_string('pet','assignsubmission_ebus'),'PET','',array('','PET'));
$preprocedure[] = $mform->createElement('advcheckbox','preprocedure2',get_string('contrastct','assignsubmission_ebus'),'Contrast CT','',array('','Contrast CT'));
$preprocedure[] = $mform->createElement('advcheckbox','preprocedure3',get_string('ldct','assignsubmission_ebus'),'Low dose CT','',array('', 'Low dose CT'));
$mform->addGroup($preprocedure,"preprocedure",'if Yes',array('<br>'), false);
$mform->addRule('preprocedure', null, 'required', null, 'client');
こんにちはTony、私の無効になっている場合は、私はフィールドが無効になっている必要があります必要なvalidation.currentlyの両方を求めている質問をするべきではない –
あなたはそれが正常に動作していると確信しています。通常、無効になっているフィールドの検証ルールも無効になると期待しています。 'addRule'行の後に' disabledIf'ルールを置いてみてください。 – Tony
はい、私はあなたのアイデアを試してみましたが、無効になっていると確信していますが、 –