0

ここに drpdown ボックスがあり、オプションを選択すると、その値が「arr」にプッシュされるため、arr には次の要素があります。

arr=['Self','Spouse''Son','Father','Father-in-law','Mother-in-law','Daughter','Mother'];

ここで私の要件は、1 つの選択ボックスで SON または父を選択し、別の選択ボックスで「Mother-In-law」または「Father-In_law」を選択した場合、「In-laws are not applied」などの警告メッセージが必要なことです。 'これが私のコードです、ここで構文エラーが発生しています、誰かこれを調べてください、

if(($(this).val()=='Son' || $(this).val()=='Father'))
  {if(arr.indexOf($(this).val()=='Father-in-law' || $(this).val()=='Mother-in-law'))>-1){
    alert('In-laws are not applicable');
    return false;}}

ありがとう。

4

1 に答える 1