郵便番号検索
・CGIのファイル名を変更した場合、line210の
<form name="SearchForm" method="post" action="ZipToAddress.cgi">
のactionを変更する
・ひとつのフォーム内で複数回利用できるようにする
まず、CGIのline157から
if ($zipofficenumberfieldname) { print "window.opener.document.$myformname.elements[$zipofficenumberfieldname].value = zipofficenumber;\n"; } if ($ziptownnumberfieldname) { print "window.opener.document.$myformname.elements[$ziptownnumberfieldname].value = ziptownnumber;\n"; } if ($addressfieldname) { print "window.opener.document.$myformname.elements[$addressfieldname].value = address;\n"; } if ($prefecturefieldname) { print "window.opener.document.$myformname.elements[$prefecturefieldname].value = prefecture;\n"; } if ($cityfieldname) { print "window.opener.document.$myformname.elements[$cityfieldname].value = city;\n"; } if ($townfieldname) { print "window.opener.document.$myformname.elements[$townfieldname].value = town;\n";
と変更。
HTML側で、引数でフォームエレメントの名前を渡していたのを、フォームの番号を渡すようにする。
これで、一応複数回利用しても、名前がかぶらない=エラー回避ができる。