- Timestamp:
- 2010/03/11 10:35:11 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tmp/version-2_5-test/html/user_data/packages/default/js/site.js
r18562 r18609 36 36 // 郵便番号入力呼び出し. 37 37 function fnCallAddress(php_url, tagname1, tagname2, input1, input2) { 38 zip1 = document.form1[tagname1].value; 39 zip2 = document.form1[tagname2].value; 40 41 if(zip1.length == 3 && zip2.length == 4) { 42 url = php_url + "?zip1=" + zip1 + "&zip2=" + zip2 + "&input1=" + input1 + "&input2=" + input2; 43 window.open(url,"nomenu","width=500,height=350,scrollbars=yes,resizable=yes,toolbar=no,location=no,directories=no,status=no"); 44 } else { 45 alert("郵便番号を正しく入力して下さい。"); 38 zip1 = document.form1[tagname1].value; 39 zip2 = document.form1[tagname2].value; 40 41 if(zip1.length == 3 && zip2.length == 4) { 42 $.get( 43 php_url, 44 {zip1: zip1, zip2: zip2, input1: input1, input2: input2}, 45 function(data) { 46 arrdata = data.split("|"); 47 if (arrdata.length > 1) { 48 fnPutAddress(input1, input2, arrdata[0], arrdata[1], arrdata[2]); 49 } else { 50 alert(data); 51 } 52 } 53 ); 54 } else { 55 alert("郵便番号を正しく入力して下さい。"); 46 56 } 47 57 } 48 58 49 59 // 郵便番号から検索した住所を渡す. 50 function fnPutAddress(input1, input2) { 51 // 親ウィンドウの存在確認。. 52 if(fnIsopener()) { 53 if(document.form1['state'].value != "") { 54 // 項目に値を入力する. 55 state_id = document.form1['state'].value; 56 town = document.form1['city'].value + document.form1['town'].value; 57 window.opener.document.form1[input1].selectedIndex = state_id; 58 window.opener.document.form1[input2].value = town; 59 } 60 } else { 61 window.close(); 62 } 60 function fnPutAddress(input1, input2, state, city, town) { 61 if(state != "") { 62 // 項目に値を入力する. 63 document.form1[input1].selectedIndex = state; 64 document.form1[input2].value = city + town; 65 } 63 66 } 64 67 … … 79 82 // セレクトボックスに項目を割り当てる. 80 83 function fnSetSelect(name1, name2, val) { 81 sele1 = document.form1[name1]; 84 sele1 = document.form1[name1]; 82 85 sele2 = document.form1[name2]; 83 86 84 87 if(sele1 && sele2) { 85 88 index=sele1.selectedIndex; 86 87 // セレクトボックスのクリア 89 90 // セレクトボックスのクリア 88 91 count=sele2.options.length 89 92 for(i = count; i >= 0; i--) { 90 93 sele2.options[i]=null; 91 94 } 92 95 93 96 // セレクトボックスに値を割り当てる。 94 97 len = lists[index].length … … 127 130 } 128 131 break; 129 case 'delete_order':130 if(!window.confirm('在庫数は手動で戻してください。\n一度削除したデータは、元に戻せません。\n削除しても宜しいですか?')){131 return;132 }133 break;134 132 case 'confirm': 135 133 if(!window.confirm('登録しても宜しいですか')){ … … 168 166 return; 169 167 } 170 break; 168 break; 171 169 default: 172 170 break; … … 185 183 } 186 184 185 function fnSetVal(key, val) { 186 fnSetFormVal('form1', key, val); 187 } 188 187 189 function fnSetFormVal(form, key, val) { 188 190 document.forms[form][key].value = val; … … 205 207 } 206 208 207 209 function fnSubmit(){ 208 210 document.form1.submit(); 209 211 } … … 215 217 'use_point' 216 218 ); 217 219 218 220 if(!document.form1['point_check'][0].checked) { 219 221 color = "#dddddd"; … … 223 225 flag = false; 224 226 } 225 227 226 228 len = list.length 227 229 for(i = 0; i < len; i++) { … … 254 256 'deliv_tel03' 255 257 ); 256 258 257 259 if(!document.form1['deliv_check'].checked) { 258 260 fnChangeDisabled(list, '#dddddd'); … … 263 265 } 264 266 265 266 // 購入時会員登録入力制限。267 function fnCheckInputMember() {268 if(document.form1['member_check']) {269 list = new Array(270 'password',271 'password_confirm',272 'reminder',273 'reminder_answer'274 );275 276 if(!document.form1['member_check'].checked) {277 fnChangeDisabled(list, '#dddddd');278 } else {279 fnChangeDisabled(list, '');280 }281 }282 }283 284 267 // 最初に設定されていた色を保存しておく。 285 268 var g_savecolor = new Array(); … … 287 270 function fnChangeDisabled(list, color) { 288 271 len = list.length; 289 272 290 273 for(i = 0; i < len; i++) { 291 274 if(document.form1[list[i]]) { … … 298 281 document.form1[list[i]].disabled = true; 299 282 g_savecolor[list[i]] = document.form1[list[i]].style.backgroundColor; 300 document.form1[list[i]].style.backgroundColor = color;//"#f0f0f0"; 301 } 283 document.form1[list[i]].style.backgroundColor = color;//"#f0f0f0"; 284 } 302 285 } 303 286 } … … 308 291 function fnCheckLogin(formname) { 309 292 var lstitem = new Array(); 310 293 311 294 if(formname == 'login_mypage'){ 312 295 lstitem[0] = 'mypage_login_email'; … … 319 302 var errflg = false; 320 303 var cnt = 0; 321 304 322 305 // 必須項目のチェック 323 306 for(cnt = 0; cnt < max; cnt++) { … … 327 310 } 328 311 } 329 330 // 必須項目が入力されていない場合 312 313 // 必須項目が入力されていない場合 331 314 if(errflg == true) { 332 315 alert('メールアドレス/パスワードを入力して下さい。'); … … 334 317 } 335 318 } 336 319 337 320 // 時間の計測. 338 321 function fnPassTime(){ … … 350 333 } else { 351 334 window.close(); 352 } 335 } 353 336 } 354 337 … … 372 355 // テキストエリアのサイズを変更する. 373 356 function ChangeSize(button, TextArea, Max, Min, row_tmp){ 374 357 375 358 if(TextArea.rows <= Min){ 376 359 TextArea.rows=Max; button.value="小さくする"; row_tmp.value=Max; … … 380 363 } 381 364 365 // お届け時間のリアル反映 366 function fnSetDelivTime(mode, r_key, s_id) { 367 var f_key, f_val; 368 var f_cnt = document.form1.length; 369 var f_data = "mode=" + mode; 370 371 // formデータの形成 372 for (i = 0; i < f_cnt; i++) { 373 f_key = document.form1[i].name; 374 f_val = document.form1[i].value; 375 if (f_key != "mode") { 376 if (f_key == r_key) { 377 if (document.form1[i].checked === true) { 378 f_data += "&" + f_key + "=" + f_val; 379 } 380 } else { 381 f_data += "&" + f_key + "=" + f_val; 382 } 383 } 384 } 385 386 // AJAX 387 $.ajax({ 388 type: "POST", 389 url: document.form1.action, 390 data: f_data, 391 dataType: "json", 392 success: function(data) { 393 var elm_s = "select#" + s_id; 394 var elm_o = elm_s + " option"; 395 $(elm_o).remove(); 396 $(elm_s).append($('<option>').attr({value: ""}).text("指定なし")); 397 for (i = 0; i < data.length; i++) { 398 if (data[i].time_id > 0) { 399 $(elm_s).append($('<option>').attr({value: data[i].time_id}).text(data[i].deliv_time)); 400 $(elm_s).width(); 401 } 402 } 403 } 404 }); 405 }
Note: See TracChangeset
for help on using the changeset viewer.