回答編集履歴
4
条件式変更
answer
CHANGED
@@ -27,4 +27,12 @@
|
|
27
27
|
$("#mfp_button_confirm").prop('disabled', false);
|
28
28
|
}
|
29
29
|
});
|
30
|
+
```
|
31
|
+
|
32
|
+
---
|
33
|
+
**また追記**
|
34
|
+
|
35
|
+
一致かどうかを調べれば
|
36
|
+
```javascript
|
37
|
+
if($('#id_select').val() == '19歳以下' && $('input[name="お問い合わせ内容"]:checked').val() == 'ビールのご購入'){
|
30
38
|
```
|
3
ソース修正
answer
CHANGED
@@ -21,12 +21,10 @@
|
|
21
21
|
```javascript
|
22
22
|
$('input[name="お問い合わせ内容"], #id_select').change(function(){
|
23
23
|
|
24
|
-
if($('#id_select').val() < 20 && $('input[name="お問い合わせ内容"]').val() == 'ビールのご購入'){
|
24
|
+
if($('#id_select').val() < 20 && $('input[name="お問い合わせ内容"]:checked').val() == 'ビールのご購入'){
|
25
25
|
$("#mfp_button_confirm").prop('disabled', true);
|
26
26
|
} else {
|
27
27
|
$("#mfp_button_confirm").prop('disabled', false);
|
28
28
|
}
|
29
29
|
});
|
30
|
-
```
|
30
|
+
```
|
31
|
-
|
32
|
-
**※「$(this).val() < 20」を「$('#id_select').val() < 20」に修正しました。**
|
2
ソース修正
answer
CHANGED
@@ -21,10 +21,12 @@
|
|
21
21
|
```javascript
|
22
22
|
$('input[name="お問い合わせ内容"], #id_select').change(function(){
|
23
23
|
|
24
|
-
if($(
|
24
|
+
if($('#id_select').val() < 20 && $('input[name="お問い合わせ内容"]').val() == 'ビールのご購入'){
|
25
25
|
$("#mfp_button_confirm").prop('disabled', true);
|
26
26
|
} else {
|
27
27
|
$("#mfp_button_confirm").prop('disabled', false);
|
28
28
|
}
|
29
29
|
});
|
30
|
-
```
|
30
|
+
```
|
31
|
+
|
32
|
+
**※「$(this).val() < 20」を「$('#id_select').val() < 20」に修正しました。**
|
1
修正
answer
CHANGED
@@ -11,4 +11,20 @@
|
|
11
11
|
if($(this).val() < 20 && $('input[name="お問い合わせ内容"]').val() == 'ビールのご購入'){
|
12
12
|
```
|
13
13
|
|
14
|
-
この一行修正のみでいけるかと思います。
|
14
|
+
この一行修正のみでいけるかと思います。
|
15
|
+
|
16
|
+
---
|
17
|
+
**追記**
|
18
|
+
|
19
|
+
問い合わせ内容の値が変わった時にも、チェックしないといけませんでした、こちらでどうでしょうか。
|
20
|
+
|
21
|
+
```javascript
|
22
|
+
$('input[name="お問い合わせ内容"], #id_select').change(function(){
|
23
|
+
|
24
|
+
if($(this).val() < 20 && $('input[name="お問い合わせ内容"]').val() == 'ビールのご購入'){
|
25
|
+
$("#mfp_button_confirm").prop('disabled', true);
|
26
|
+
} else {
|
27
|
+
$("#mfp_button_confirm").prop('disabled', false);
|
28
|
+
}
|
29
|
+
});
|
30
|
+
```
|