質問編集履歴

3

修正しました。

2019/04/05 02:43

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -1,4 +1,4 @@
1
- WordPress コンタクトフォーム7でチェックボックスとラジオボタンを設置したフォームを作成しており、
1
+ コンタクトフォーム7でチェックボックスとラジオボタンを設置したフォームを作成しており、
2
2
 
3
3
  「Contact Form 7 add confirm」で確認画面を追加しています。
4
4
 
@@ -19,6 +19,8 @@
19
19
  コンタクトフォーム7 プラグインの「Contact Form 7 add confirm」のjs内のコードになります。
20
20
 
21
21
 
22
+
23
+ ```ここに言語を入力
22
24
 
23
25
 
24
26
 
@@ -131,3 +133,43 @@
131
133
  }
132
134
 
133
135
  });
136
+
137
+ ```
138
+
139
+
140
+
141
+ ---
142
+
143
+ 下記、フォーム入力画面の画像になります。
144
+
145
+
146
+
147
+ ![イメージ説明](efeca2b1cd6cfaf47be6db7420a95233.jpeg)
148
+
149
+
150
+
151
+ ---
152
+
153
+ 下記画像は、確認画面になります。
154
+
155
+ チェックされたボックスは消えて、
156
+
157
+ 選択されていない項目はそのまま表示されてしまいます。
158
+
159
+
160
+
161
+ ![イメージ説明](a54a0b1a71dcd1cfc9b918ed91eca76a.jpeg)
162
+
163
+
164
+
165
+ コンタクトフォーム7のチェックボックスの箇所は以下になります。
166
+
167
+ ```ここに言語を入力
168
+
169
+ <p>[checkbox* checkbox-000 use_label_element "サンプル01" "サンプル02" "サンプル03" "サンプル04"]</p>
170
+
171
+ ```
172
+
173
+
174
+
175
+ 自動メールで届く内容は、ちゃんと選択された内容のみ反映されております。

2

追記いたしました。

2019/04/05 02:43

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -11,3 +11,123 @@
11
11
  入力値のみを確認画面に表示ができればと、色々とやっておりますが上手くいきません。
12
12
 
13
13
  「チェックボックス」と「ラジオボタン」を入力した項目のみを表示させたいのですが可能でしょうか。
14
+
15
+
16
+
17
+
18
+
19
+ コンタクトフォーム7 プラグインの「Contact Form 7 add confirm」のjs内のコードになります。
20
+
21
+
22
+
23
+
24
+
25
+ jQuery(jQuery.find("input[name=_wpcf7_unit_tag]")).each(function(){
26
+
27
+ if(jQuery(this).val() == unit_tag) {
28
+
29
+ var parent = jQuery(this).parents("form");
30
+
31
+
32
+
33
+
34
+
35
+ var responseOutput = parent.find('div.wpcf7-response-output');
36
+
37
+ responseOutput.addClass("wpcf7c-force-hide");
38
+
39
+
40
+
41
+ // 確認画面表示
42
+
43
+ // テキストエリアを伸ばす
44
+
45
+ parent.find("textarea").each(function(){
46
+
47
+ if(this.scrollHeight > this.offsetHeight){
48
+
49
+ this.style.height = (this.scrollHeight + 10) + 'px';
50
+
51
+ }
52
+
53
+ });
54
+
55
+ parent.find("textarea").attr("readonly", true).addClass("wpcf7c-conf");
56
+
57
+ parent.find("select").each(function(){
58
+
59
+ jQuery(this).attr("readonly", true).attr("disabled", true).addClass("wpcf7c-conf");
60
+
61
+ jQuery(this).after(
62
+
63
+ jQuery('<input type="hidden" />').attr("name", jQuery(this).attr("name")).val(jQuery(this).val()).addClass("wpcf7c-conf-hidden")
64
+
65
+ );
66
+
67
+ });
68
+
69
+ parent.find("input").each(function(){
70
+
71
+ switch(jQuery(this).attr("type")) {
72
+
73
+ case "submit":
74
+
75
+ case "button":
76
+
77
+ case "hidden":
78
+
79
+ case "image":
80
+
81
+ // なにもしない
82
+
83
+ break;
84
+
85
+ case "radio":
86
+
87
+ case "checkbox":
88
+
89
+ // 選択されているものだけ対処
90
+
91
+ jQuery(this).attr("readonly", true).attr("disabled", true).addClass("wpcf7c-conf");
92
+
93
+ if(jQuery(this).is(":checked")) {
94
+
95
+ jQuery(this).after(
96
+
97
+ jQuery('<input type="hidden" />').attr("name", jQuery(this).attr("name")).val(jQuery(this).val()).addClass("wpcf7c-conf-hidden")
98
+
99
+ );
100
+
101
+ }
102
+
103
+ break;
104
+
105
+ case "file":
106
+
107
+ jQuery(this).attr("readonly", true).addClass("wpcf7c-elm-step1").addClass("wpcf7c-force-hide");
108
+
109
+ jQuery(this).after(
110
+
111
+ jQuery('<input type="text" />').attr("name", (jQuery(this).attr("name") + "_conf")).val(jQuery(this).val()).addClass("wpcf7c-conf-hidden").addClass("wpcf7c-conf").attr("readonly", true).attr("disabled", true)
112
+
113
+ );
114
+
115
+
116
+
117
+ break;
118
+
119
+ default:
120
+
121
+ jQuery(this).attr("readonly", true).addClass("wpcf7c-conf");
122
+
123
+ jQuery(this).after(
124
+
125
+ jQuery('<input type="hidden" />').attr("name", jQuery(this).attr("name")).val(jQuery(this).val()).addClass("wpcf7c-conf-hidden")
126
+
127
+ );
128
+
129
+ break;
130
+
131
+ }
132
+
133
+ });

1

内容を修正いたしました。

2019/04/05 01:41

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -4,8 +4,10 @@
4
4
 
5
5
  その確認画面の時に「チェックボックス」と「ラジオボタン」が、
6
6
 
7
- 選択したボックスは消えて、選択していないボックスは表示されたままになっております。
7
+ 選択したチェックボックスは消えて、選択していないチェックボックスは表示されたままになっています。
8
8
 
9
9
 
10
10
 
11
+ 入力値のみを確認画面に表示ができればと、色々とやっておりますが上手くいきません。
12
+
11
- 可能であれば、撰択した項目のみを表示させたいのですが可能でしょうか。
13
+ 「チェックボックス」と「ラジオボタン」を入力した項目のみを表示させたいのですが可能でしょうか。