質問編集履歴
2
コード部分をmarkdown記法でシンタックスハイライトにしました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -28,6 +28,8 @@
|
|
28
28
|
|
29
29
|
|
30
30
|
|
31
|
+
```html
|
32
|
+
|
31
33
|
<section>
|
32
34
|
|
33
35
|
<form action="#">
|
@@ -92,12 +94,16 @@
|
|
92
94
|
|
93
95
|
</section>
|
94
96
|
|
97
|
+
```
|
98
|
+
|
95
99
|
|
96
100
|
|
97
101
|
■ b.html
|
98
102
|
|
99
103
|
|
100
104
|
|
105
|
+
```html
|
106
|
+
|
101
107
|
<form name="form">
|
102
108
|
|
103
109
|
<input name="type" value="" id="type">
|
@@ -110,6 +116,8 @@
|
|
110
116
|
|
111
117
|
<form>
|
112
118
|
|
119
|
+
```
|
120
|
+
|
113
121
|
|
114
122
|
|
115
123
|
|
@@ -122,6 +130,8 @@
|
|
122
130
|
|
123
131
|
|
124
132
|
|
133
|
+
```javascript
|
134
|
+
|
125
135
|
<script>
|
126
136
|
|
127
137
|
function order(frm){
|
@@ -134,12 +144,16 @@
|
|
134
144
|
|
135
145
|
</script>
|
136
146
|
|
147
|
+
```
|
148
|
+
|
137
149
|
|
138
150
|
|
139
151
|
■ b.html側
|
140
152
|
|
141
153
|
|
142
154
|
|
155
|
+
```javascript
|
156
|
+
|
143
157
|
<script>
|
144
158
|
|
145
159
|
if('undefined' !== typeof window.addEventListener)
|
@@ -166,6 +180,8 @@
|
|
166
180
|
|
167
181
|
</script>
|
168
182
|
|
183
|
+
```
|
184
|
+
|
169
185
|
|
170
186
|
|
171
187
|
|
1
問題点をより詳細に記述しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,7 +18,169 @@
|
|
18
18
|
|
19
19
|
|
20
20
|
|
21
|
+
|
22
|
+
|
23
|
+
現在のhtmlは下記のようになっています。
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
■ a.html
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
<section>
|
32
|
+
|
33
|
+
<form action="#">
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
<select id="type" name="type">
|
38
|
+
|
39
|
+
<option>---選択---</option>
|
40
|
+
|
41
|
+
<option>土地</option>
|
42
|
+
|
43
|
+
<option>一戸建て</option>
|
44
|
+
|
45
|
+
<option>マンション</option>
|
46
|
+
|
47
|
+
</select>
|
48
|
+
|
49
|
+
<select id="pref" name="pref">
|
50
|
+
|
51
|
+
<option>---選択---</option>
|
52
|
+
|
53
|
+
<option>群馬県</option>
|
54
|
+
|
55
|
+
</select>
|
56
|
+
|
57
|
+
<select id="city" name="city">
|
58
|
+
|
59
|
+
<option>---選択---</option>
|
60
|
+
|
61
|
+
<option>A市</option>
|
62
|
+
|
63
|
+
<option>B市</option>
|
64
|
+
|
65
|
+
<option>C市</option>
|
66
|
+
|
67
|
+
<option>D市</option>
|
68
|
+
|
69
|
+
<option>E市</option>
|
70
|
+
|
71
|
+
</select>
|
72
|
+
|
73
|
+
<select id="town" name="town">
|
74
|
+
|
75
|
+
<option>---選択---</option>
|
76
|
+
|
77
|
+
<option>A町</option>
|
78
|
+
|
79
|
+
<option>B町</option>
|
80
|
+
|
81
|
+
<option>C町</option>
|
82
|
+
|
83
|
+
<option>D町</option>
|
84
|
+
|
85
|
+
<option>E町</option>
|
86
|
+
|
87
|
+
</select>
|
88
|
+
|
89
|
+
<button type="button" onclick="order(this.form);"><img src="Btn_off.png" alt=""></button>
|
90
|
+
|
91
|
+
</form>
|
92
|
+
|
93
|
+
</section>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
■ b.html
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<form name="form">
|
102
|
+
|
103
|
+
<input name="type" value="" id="type">
|
104
|
+
|
105
|
+
<input name="pref" value="" id="pref">
|
106
|
+
|
107
|
+
<input name="city" value="" id="city">
|
108
|
+
|
109
|
+
<input name="town" value="" id="town">
|
110
|
+
|
111
|
+
<form>
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
21
|
-
j
|
117
|
+
また、現在のjsは下記のようになっています。
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
■ a.html側
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
<script>
|
126
|
+
|
127
|
+
function order(frm){
|
128
|
+
|
129
|
+
var a = frm.elements["type"].options[frm.elements["type"].selectedIndex].text;
|
130
|
+
|
131
|
+
location.href = "html/mail.html" + "?" + encodeURIComponent(a);
|
132
|
+
|
133
|
+
}
|
134
|
+
|
135
|
+
</script>
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
■ b.html側
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
<script>
|
144
|
+
|
145
|
+
if('undefined' !== typeof window.addEventListener)
|
146
|
+
|
147
|
+
window.addEventListener('load',func,false);
|
148
|
+
|
149
|
+
else if ('undefined' !== typeof window.attachEvent)
|
150
|
+
|
151
|
+
window.attachEvent('onload',func);
|
152
|
+
|
153
|
+
function func(){
|
154
|
+
|
155
|
+
if(location.search){
|
156
|
+
|
157
|
+
var str = decodeURIComponent(location.search);
|
158
|
+
|
159
|
+
var a = str.split("?");
|
160
|
+
|
161
|
+
document.forms["form"].elements["type"].value = a[1];
|
162
|
+
|
163
|
+
}
|
164
|
+
|
165
|
+
}
|
166
|
+
|
167
|
+
</script>
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
ひとつだけなら動きますが、複数になるとうまくいきません。
|
174
|
+
|
175
|
+
おそらくonloadが複数に効かないからだと思われますが
|
176
|
+
|
177
|
+
他の方法が分からず、止まっています。
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
上記の記述をこう直せばいい、他のこういう記述で出来る等
|
182
|
+
|
183
|
+
ご教授いただければと思います。
|
22
184
|
|
23
185
|
|
24
186
|
|