質問編集履歴
1
コード全文の追加です。
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,7 +8,155 @@
|
|
8
8
|
|
9
9
|
|
10
10
|
|
11
|
+
```<!DOCTYPE html>
|
12
|
+
|
13
|
+
<html>
|
14
|
+
|
15
|
+
<head>
|
16
|
+
|
17
|
+
<title>楽 会員登録</title>
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
22
|
+
|
23
|
+
<meta charset="utf-8">
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
<style type="text/css">
|
28
|
+
|
29
|
+
body {
|
30
|
+
|
31
|
+
background-color: #fcebd5;
|
32
|
+
|
33
|
+
background-repeat:no-repeat;
|
34
|
+
|
35
|
+
background-attachment: fixed;
|
36
|
+
|
37
|
+
background-position: center top;
|
38
|
+
|
39
|
+
}
|
40
|
+
|
41
|
+
#center { text-align:center }
|
42
|
+
|
43
|
+
.s16 {font-size:16pt}
|
44
|
+
|
45
|
+
.s14 {font-size:14pt}
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
.button {
|
50
|
+
|
51
|
+
text-align:center;
|
52
|
+
|
53
|
+
width:150px;
|
54
|
+
|
55
|
+
font-size:24px;
|
56
|
+
|
57
|
+
font-weight:bold;
|
58
|
+
|
59
|
+
text-decoration:none;
|
60
|
+
|
61
|
+
display:block;
|
62
|
+
|
63
|
+
text-align:center;
|
64
|
+
|
65
|
+
padding:8px 0 10px;
|
66
|
+
|
67
|
+
color:#fff;
|
68
|
+
|
69
|
+
background-color:#49a9d4;
|
70
|
+
|
71
|
+
border-radius:5px;
|
72
|
+
|
73
|
+
box-shadow:2px 2px #1a6ea0;
|
74
|
+
|
75
|
+
text-shadow:0 -1px #1a6ea0;
|
76
|
+
|
77
|
+
}
|
78
|
+
|
79
|
+
</style>
|
80
|
+
|
81
|
+
|
82
|
+
|
11
|
-
|
83
|
+
<!-- ↓JavaScriptの処理を追加 -->
|
84
|
+
|
85
|
+
<script type="text/javascript">
|
86
|
+
|
87
|
+
function isRegNum(obj){
|
88
|
+
|
89
|
+
var str=obj.value; /* 入力値 */
|
90
|
+
|
91
|
+
if(str.match(/[^0-9]/g)){ /* 数値以外の文字列が含まれていた場合 */
|
92
|
+
|
93
|
+
alert (str.match(/[^0-9]/g)+'\n\n数値以外が含まれています'); /* アラート表示 */
|
94
|
+
|
95
|
+
obj.value=""; /* テキストボックスを空にする */
|
96
|
+
|
97
|
+
return false;
|
98
|
+
|
99
|
+
}
|
100
|
+
|
101
|
+
}
|
102
|
+
|
103
|
+
function checkStr(){
|
104
|
+
|
105
|
+
var str1 = document.getElementById("password1").value;
|
106
|
+
|
107
|
+
var str2 = document.getElementById("password2").value;
|
108
|
+
|
109
|
+
if (str1.match(/[^0-9 a-z a-z A-Z]/g)){
|
110
|
+
|
111
|
+
alert("英数字以外が含まれています\n(" + str.match(/[^0-9 a-z a-z A-Z]/g) + ")");
|
112
|
+
|
113
|
+
return false;
|
114
|
+
|
115
|
+
}
|
116
|
+
|
117
|
+
if (str2.match(/[^0-9 a-z a-z A-Z]/g)){
|
118
|
+
|
119
|
+
alert("英数字以外が含まれています\n(" + str.match(/[^0-9 a-z a-z A-Z]/g) + ")");
|
120
|
+
|
121
|
+
return false;
|
122
|
+
|
123
|
+
}
|
124
|
+
|
125
|
+
if((str1!="") && (str2!="")){
|
126
|
+
|
127
|
+
if(str1 != str2){
|
128
|
+
|
129
|
+
alert("パスワードが一致しません。");
|
130
|
+
|
131
|
+
document.getElementById("password1").value="";
|
132
|
+
|
133
|
+
document.getElementById("password2").value="";
|
134
|
+
|
135
|
+
return false;
|
136
|
+
|
137
|
+
}
|
138
|
+
|
139
|
+
}
|
140
|
+
|
141
|
+
}
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
function checkMail(){
|
146
|
+
|
147
|
+
var str = document.getElementById("userid").value;
|
148
|
+
|
149
|
+
if(str.match(/^([a-z0-9_.\-])+@([a-z0-9_.\-])+[^.]$/i)){
|
150
|
+
|
151
|
+
<!-- alert("入力OKです!"); -->
|
152
|
+
|
153
|
+
}else{
|
154
|
+
|
155
|
+
alert("メールアドレスの形式が不正です!");
|
156
|
+
|
157
|
+
}
|
158
|
+
|
159
|
+
}
|
12
160
|
|
13
161
|
|
14
162
|
|
@@ -30,26 +178,250 @@
|
|
30
178
|
|
31
179
|
function page_jump(){
|
32
180
|
|
181
|
+
alert("hello1");
|
182
|
+
|
33
183
|
window.location.href='customer_information.php';
|
34
184
|
|
35
|
-
re
|
36
|
-
|
37
|
-
}
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
185
|
+
alert("hello2");
|
186
|
+
|
187
|
+
}
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
function nyuuryokuzumi(){
|
192
|
+
|
193
|
+
var firstname = null;
|
194
|
+
|
195
|
+
var lastname = null ;
|
196
|
+
|
197
|
+
var adressno = null;
|
198
|
+
|
199
|
+
var adress1 = null;
|
200
|
+
|
201
|
+
var adress2 = null;
|
202
|
+
|
203
|
+
var adress3 = null;
|
204
|
+
|
205
|
+
var phone = null;
|
206
|
+
|
207
|
+
var userid = null;
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
str=document.cookie;
|
212
|
+
|
213
|
+
if(!str){
|
214
|
+
|
215
|
+
return false;
|
216
|
+
|
217
|
+
}
|
218
|
+
|
219
|
+
var str2=null;
|
220
|
+
|
221
|
+
//result = s.substring( start [, end] )
|
222
|
+
|
223
|
+
result = str.split(";");
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
result.forEach( function (str2) {
|
228
|
+
|
229
|
+
if(str2.indexOf("firstname")>0){
|
230
|
+
|
231
|
+
firstname =str2.substring( ("'firstname=").length , str2.length-1 );
|
232
|
+
|
233
|
+
}
|
234
|
+
|
235
|
+
if(str2.indexOf("lastname")>0){
|
236
|
+
|
237
|
+
lastname = str2.substring( ("'lastname=").length+1 , str2.length-1 );
|
238
|
+
|
239
|
+
}
|
240
|
+
|
241
|
+
if(str2.indexOf("adressno")>0){
|
242
|
+
|
243
|
+
adressno = str2.substring( ("'adessno=").length+2 , str2.length-1 );
|
244
|
+
|
245
|
+
}
|
246
|
+
|
247
|
+
if(str2.indexOf("adress1")>0){
|
248
|
+
|
249
|
+
adress1 = str2.substring( ("'adress1=").length+1 , str2.length-1 );
|
250
|
+
|
251
|
+
}
|
252
|
+
|
253
|
+
if(str2.indexOf("adress2")>0){
|
254
|
+
|
255
|
+
adress2 = str2.substring( ("'adress2=").length+1 , str2.length-1 );
|
256
|
+
|
257
|
+
}
|
258
|
+
|
259
|
+
if(str2.indexOf("adress3")>0){
|
260
|
+
|
261
|
+
adress3 = str2.substring( ("'adress3=").length+1 , str2.length-1 );
|
262
|
+
|
263
|
+
}
|
264
|
+
|
265
|
+
if(str2.indexOf("phone")>0){
|
266
|
+
|
267
|
+
phone = str2.substring( ("'phone=").length+1 , str2.length-1 );
|
268
|
+
|
269
|
+
}
|
270
|
+
|
271
|
+
if(str2.indexOf("userid")>0){
|
272
|
+
|
273
|
+
userid = str2.substring( ("'userid=").length+1 , str2.length-1 );
|
274
|
+
|
275
|
+
}
|
276
|
+
|
277
|
+
});
|
278
|
+
|
279
|
+
console.log ("firstname:" + firstname);
|
280
|
+
|
281
|
+
console.log ("lastname:" + lastname);
|
282
|
+
|
283
|
+
console.log ("adressno:" + adressno);
|
284
|
+
|
285
|
+
console.log ("adress1:" + adress1);
|
286
|
+
|
287
|
+
console.log ("adress2:" + adress2);
|
288
|
+
|
289
|
+
console.log ("adress3:" + adress3);
|
290
|
+
|
291
|
+
console.log ("phone:" + phone);
|
292
|
+
|
293
|
+
console.log ("userid:" + userid);
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
document.getElementById("firstname").value=firstname;
|
298
|
+
|
299
|
+
document.getElementById("lastname").value=lastname;
|
300
|
+
|
301
|
+
document.getElementById("adressno").value=adressno;
|
302
|
+
|
303
|
+
document.getElementById("adress1").value=adress1;
|
304
|
+
|
305
|
+
document.getElementById("adress2").value=adress2;
|
306
|
+
|
307
|
+
document.getElementById("adress3").value=adress3;
|
308
|
+
|
309
|
+
document.getElementById("phone").value=phone;
|
310
|
+
|
311
|
+
document.getElementById("userid").value=userid;
|
312
|
+
|
313
|
+
}
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
</script>
|
318
|
+
|
319
|
+
</head>
|
320
|
+
|
321
|
+
<body onload="nyuuryokuzumi()">
|
322
|
+
|
323
|
+
<p id="center">
|
324
|
+
|
325
|
+
<img src="ラックロゴ.png">
|
326
|
+
|
327
|
+
</p>
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
<form method="post">
|
332
|
+
|
333
|
+
<div id="center">
|
334
|
+
|
335
|
+
<p><span class ="s16" >基本情報入力</span></p>
|
336
|
+
|
337
|
+
</br>
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
<p><span class ="s14" >お名前</span></p>
|
342
|
+
|
343
|
+
<div align = "center"><table>
|
344
|
+
|
345
|
+
<td><tr><p>姓(漢字)<input type="text" name="firstname" id="firstname"/></tr></td>
|
346
|
+
|
347
|
+
<td><tr><p>名(漢字)<input type="text" name="lastname" id="lastname"/></tr></td>
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
<br/>
|
352
|
+
|
353
|
+
<p><span class ="s16" >ご住所</span></p>
|
354
|
+
|
355
|
+
<P><span class ="s14">郵便番号の"-"は入力しないで下さい。</span></P>
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
<td><tr><p>郵便番号<input type="text" name="adressno" id="adressno" onchange="isRegNum(this)" /></p></tr><td>
|
360
|
+
|
361
|
+
<td><tr><p>住所1<input type="text" name="adress1" id="adress1"/></p></tr></td>
|
362
|
+
|
363
|
+
<td><tr><p>住所2<input type="text" name="adress2" id="adress2" /></tr><td>
|
364
|
+
|
365
|
+
<td><tr><p>住所3<input type="text" name="adress3" id="adress3" /> </p></tr></td>
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
<br/>
|
370
|
+
|
371
|
+
<span class ="s14" >お電話番号</span> -は入力しないでください
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
<td><tr><p>電話番号<input type="text" name="phone" id="phone" onchange="isRegNum(this)" /></p></tr></td>
|
376
|
+
|
377
|
+
<div id="center"><img src="100x25.png"></div>
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
<p><span class ="s14" >ユーザーID(メールアドレス)</span></p>
|
382
|
+
|
383
|
+
<td><tr><p>ユーザーID<input type="text" id="userid" name = "userid" id="userid" onchange="checkMail()"/></tr></td>
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
<div id="center"><img src="100x25.png"></div>
|
388
|
+
|
389
|
+
<span class ="s14" ><p>パスワード(半角英数字)</p></span>
|
390
|
+
|
391
|
+
<td><tr><p>パスワード<input type="password" name = "password1" id="password1" onblur="checkStr()"></p></tr><td>
|
392
|
+
|
393
|
+
</br>
|
394
|
+
|
395
|
+
<td><tr><p>もう一度 <input type="password" id="password2" onblur="checkStr()"></p></tr></td>
|
396
|
+
|
397
|
+
</table></div>
|
398
|
+
|
399
|
+
<div align="center"><img src="100x25.png"></div>
|
400
|
+
|
401
|
+
<div align="center">
|
402
|
+
|
403
|
+
<a style="text-decoration:none;" onclick="page_jump()">
|
404
|
+
|
405
|
+
<button class="button">登録</button></a></div></br>
|
406
|
+
|
407
|
+
</div>
|
408
|
+
|
409
|
+
</form>
|
410
|
+
|
411
|
+
</table>
|
412
|
+
|
413
|
+
</body>
|
414
|
+
|
415
|
+
</html>
|
52
416
|
|
53
417
|
|
54
418
|
|
55
419
|
```
|
420
|
+
|
421
|
+
本来はボタンを押すとfunction nyuuryokuzumi()に飛ぶのですが、検証のため、直接page_jump()に飛ぶようにしています。
|
422
|
+
|
423
|
+
page_jump()中のalert文はhello1,hello2とも動作確認出来ます。
|
424
|
+
|
425
|
+
よってwinndow.location.href文が動作していない事がわかります。
|
426
|
+
|
427
|
+
よろしくお願い致します。
|