テキスト ボックスとドロップダウンがある検索フォームがあり、その一部が機能していません。オプションをクリックして非表示にすると機能します。別のオプションを選択すると、バックアップが表示されます。
ここに例があります。
特定のオプションを選択すると、別のテキスト ボックスが非表示になり、表示または非表示になります。何かを選択してからナビメニューに移動し、戻って非表示にする必要がある1つのボックスを表示すると. これが私が物事を隠すために使用しているコードです。デフォルトに戻さず、ページの読み込み時に非表示にする理由がわかりません。これはカミソリビューページにあります。
@*hidefields - Spec Guide*@
//condition fields for the end user request form make sure you change the field ID to yours.
$(document).ready(function () {
//check to see if you are on the end users request page
if (location.pathname === '/Reporting/Summary') {
//if (document.location.href='/Tickets/New'){
//toggle the field ,description and title invisible
$('label for="CustomFieldValue@field.FieldID":contains(* On what page of the Spec Guide:)').toggle();
$('input#CustomFieldValue3').parent().toggle();
//monitor the dropdown field
$('select#CustomFieldValue2').change(function(endUserselect) {
//grab the value of the dropdown
var userSelection = $('select#CustomFieldValue2 option:selected').text();
//do the compare and toggle the field ,description and title visible
if (userSelection === 'Spec Guide') {
$('label for="CustomFieldValue@field.FieldID":contains(* On what page of the Spec Guide:)').toggle();
$('input#CustomFieldValue3').parent().toggle();
}
//hide them again if the user changes his mind
else {
$('label for="CustomFieldValue@field.FieldID":contains(* On what page of the Spec Guide:)').hide();
$('input#CustomFieldValue3').parent().hide();
}
});
}
});
@*hidefields - Spec Guide*@