<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>郵便番号検索</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="<html:rewrite page='/view/css/webform.css'/>" />
</head>
<body>
	<script type="text/javascript" >
        function setAddress() {
            if (!window.opener || window.opener.closed) {
                window.alert('メインウィンドウがありません');
            } else {
                window.opener.searchAddress();
            }
        }

    </script>
</head>
<body>
<html:form action="/Postal">
    <table>
        <tr>
            <th>都道府県</th>
            <td><html:text property="postalAddress1" maxlength="30" value="${postalAddress1}"/></td>
        </tr>
        <tr>
            <th>市区郡</th>
            <td><html:text property="postalAddress2" maxlength="30" value="${postalAddress2}"/></td>
        </tr>
        <tr>
            <th>町名</th>
            <td><html:text property="postalAddress3" maxlength="40" value="${postalAddress3}"/></td>
        </tr>
    </table>
    <br />
    <input type="button" value="住所を入力する" onclick="setAddress();" />
    <input type="button" value="閉じる" onclick="window.close();" />
</html:form>

</body>
</html>