📄 reciveaddress_form.jsp
字号:
<%@page contentType="text/html;charset=utf-8"%><%@include file="../common/taglib.jsp"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>编辑送货地址 - 当当网</title> <link href="${pageContext.request.contextPath}/css/login.css" rel="stylesheet" type="text/css" /> <link href="${pageContext.request.contextPath}/css/page_bottom.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="${pageContext.request.contextPath }/js/common.js"></script> <script type="text/javascript"> //定义Address 构造方法 function Address(receiveName,fullAddress,postalCode,mobile,phone,beDefault){ this.receiveName = receiveName ; this.fullAddress = fullAddress ; this.postalCode = postalCode ; this.mobile = mobile ; this.phone = phone ; this.beDefault = beDefault ; } //定义用以存储地址列表的数组 var addresses = new Array() ; //用户选择地址时要调用的方法 function change(){ value = document.getElementById('id').value ; address = addresses[value] ; document.getElementById('addressName').value = address.receiveName ; document.getElementById('fullAddress').value = address.fullAddress ; document.getElementById('postCode').value = address.postalCode ; document.getElementById('mobileNo').value = address.mobile ; document.getElementById('phoneNo').value = address.phone ; } function commit(url){ new Ajax.Request(url,{method:"post",asynchronous:false,parameters:Form.serialize(document.forms[0]),onComplete:function(){ location.reload(); }}); } </script> </head> <body onload="change();"> <%@include file="../common/head1.jsp"%> <div class="login_step"> <span class="red_bold">编辑送货地址</span> </div> <br /> <div class="fill_message"> <form method="post" id="ctl00"> <a href="showOrderOne.do">返回订单步骤</a> | 选择送货地址 <select id="id" name="id" class="text_input" onchange="change();"> <c:forEach items="${address}" var="receiveAddress"> <script> addresses["${receiveAddress.id}"] = new Address("${receiveAddress.receiveName}","${receiveAddress.fullAddress}","${receiveAddress.postalCode}","${receiveAddress.mobile}","${receiveAddress.phone}","${receiveAddress.beDefault}") ; </script> <c:choose> <c:when test="${receiveAddress.beDefault}"> <option value="${receiveAddress.id}" selected="selected"> ${receiveAddress.receiveName} (默认) </option> </c:when> <c:otherwise> <option value="${receiveAddress.id}"> ${receiveAddress.receiveName} </option> </c:otherwise> </c:choose> </c:forEach> </select> <input type="button" class="button_1" value="设为默认" onclick="commit('setDefaultAddress.do');" /> <input type="button" class="button_1" value="删除" onclick="commit('deleteAddress.do')" /> <br /> <br /> <table class="tab_login"> <tr> <td valign="top" class="w1"> 收货人地址: </td> <td> <input type="text" name="receiveName" id="addressName" class="text_input" /> </td> </tr> <tr> <td valign="top" class="w1"> 详细送货地址: </td> <td> <input type="text" name="fullAddress" id="fullAddress" class="text_input"/> </td> </tr> <tr> <td valign="top" class="w1"> 收货人邮政编码: </td> <td> <input type="text" name="postalCode" id="postCode" class="text_input" maxlength="6" /> </td> </tr> <tr> <td valign="top" class="w1"> 收货人手机号: </td> <td> <input type="text" name="mobile" id="mobileNo" class="text_input" maxlength="11"/> </td> </tr> <tr> <td valign="top" class="w1"> 收货人电话号: </td> <td> <input type="text" name="phone" id="phoneNo" class="text_input" /> </td> </tr> </table> <div class="login_in"> <input type="button" class="button_1" value="更改" onclick="commit('modifyAddress.do');" /> <input type="button" value=">>保存为新地址" onclick="commit('createAddress.do');" /> </div> </form> </div> <%@include file="../common/foot1.jsp"%> </body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -