Changeset 23062 for branches/version-2_13-dev/html/js/eccube.js
- Timestamp:
- 2013/08/14 17:55:34 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_13-dev/html/js/eccube.js
r23061 r23062 21 21 */ 22 22 23 function chgImg(fileName,img){24 if (typeof(img) == "object") {25 img.src = fileName;26 } else {27 document.images[img].src = fileName;28 }29 }30 31 function chgImgImageSubmit(fileName,imgObj){32 imgObj.src = fileName;33 }34 35 // 郵便番号入力呼び出し.36 function fnCallAddress(php_url, tagname1, tagname2, input1, input2) {37 zip1 = document.form1[tagname1].value;38 zip2 = document.form1[tagname2].value;39 40 if(zip1.length == 3 && zip2.length == 4) {41 $.get(42 php_url,43 {zip1: zip1, zip2: zip2, input1: input1, input2: input2},44 function(data) {45 arrdata = data.split("|");46 if (arrdata.length > 1) {47 fnPutAddress(input1, input2, arrdata[0], arrdata[1], arrdata[2]);48 } else {49 alert(data);50 }51 }52 );53 } else {54 alert("郵便番号を正しく入力して下さい。");55 }56 }57 58 // 郵便番号から検索した住所を渡す.59 function fnPutAddress(input1, input2, state, city, town) {60 if(state != "") {61 // 項目に値を入力する.62 document.form1[input1].selectedIndex = state;63 document.form1[input2].value = city + town;64 }65 }66 67 function fnSetFocus(name) {68 if(document.form1[name]) {69 document.form1[name].focus();70 }71 }72 73 23 // セレクトボックスに項目を割り当てる. 74 24 function fnSetSelect(name1, name2, val) { … … 538 488 }; 539 489 490 common.chgImg = function(fileName,img){ 491 if (typeof(img) == "object") { 492 img.src = fileName; 493 } else { 494 document.images[img].src = fileName; 495 } 496 }; 497 498 common.chgImgImageSubmit = function(fileName,imgObj){ 499 imgObj.src = fileName; 500 }; 501 502 // 郵便番号入力呼び出し. 503 common.getAddress = function(php_url, tagname1, tagname2, input1, input2) { 504 var zip1 = document.form1[tagname1].value; 505 var zip2 = document.form1[tagname2].value; 506 507 if(zip1.length == 3 && zip2.length == 4) { 508 $.get( 509 php_url, 510 {zip1: zip1, zip2: zip2, input1: input1, input2: input2}, 511 function(data) { 512 var arrData = data.split("|"); 513 if (arrData.length > 1) { 514 eccube.common.putAddress(input1, input2, arrData[0], arrData[1], arrData[2]); 515 } else { 516 alert(data); 517 } 518 } 519 ); 520 } else { 521 alert("郵便番号を正しく入力して下さい。"); 522 } 523 }; 524 525 // 郵便番号から検索した住所を渡す. 526 common.putAddress = function(input1, input2, state, city, town) { 527 if(state != "") { 528 // 項目に値を入力する. 529 document.form1[input1].selectedIndex = state; 530 document.form1[input2].value = city + town; 531 } 532 }; 533 534 common.setFocus = function(name) { 535 if(document.form1[name]) { 536 document.form1[name].focus(); 537 } 538 }; 539 540 540 // 名前空間の重複を防ぐ 541 541 if (window.eccube === undefined) {
Note: See TracChangeset
for help on using the changeset viewer.