Re: [JSP ] 問一下關於傳值的問題

看板java作者時間19年前 (2006/07/02 15:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串8/9 (看更多)
你台中, 台南的Value就是"1" & "2".... 回傳 "1" or "2" 給你是應該, 傳"台中", "台南"給你是悲哀... ※ 引述《bigtq13.bbs@ptt.cc (Tabitha~)》之銘言: : <%@ page import="java.sql.*" %> : <%@ page contentType="text/html;charset=UTF-8" %> : <html> : <head> : <title>註冊帳號</title> : <meta http-equiv="Content-Type" content = "text/html;charset=UTF-8"> : </head> : <script> : </script> : <body> : <form name="form" method="post" action="RegSucc.jsp"> : *身分證字號:<input name="id_num" type="text" id="id_num" size ="10"><br> : *新密碼:<input name="psw1" type="password" id="psw1" size ="15"><br> : *確認密碼:<input name="psw2" type="password" id="psw2" size ="15"><br> : <table> : <tr> : <td> : *通訊地址: : </td> : <td> : <table id=row1> : <tr> : <td> : <select name = addrcounty onchange='getData(this)' > : <option value="1" default>台中</option> : <option value="2">台南</option> : </select> : </td> : </tr> : </table> : </td> : <td> : <table id=row2> : <tr id=row2> : <td> : <select name = addrcity> : <option value="萬里">萬里</option> : <option value="佳興">佳興</option> : </select> : </td> : </tr> : </table> : <table id=row3 style="display: none;"> : <tr> : <td> : <select> : <option value="大里">大里</option> : <option value="白河">白河</option> : </select> : </td> : </tr> : </table> : </td> : <td> : <input name="addrother" type="text" id="addrother" size ="20"> : </td> : </tr> : </table> : <input type="submit" value="傳送"> : </form> : </body> : <script language"javascript"> : function getData(obj) : { : var d2 = document.getElementById("row2"); : var d3 = document.getElementById("row3"); : if(obj.value == 1) : { : d2.style.display = "block"; : d3.style.display = "none"; //hidden : } : if(obj.value == 2) : { : d2.style.display = "none"; // hidden : d3.style.display = "block"; : } : } : </script> : </html> : 我身分證、密碼這些資料都傳得過去,就通訊地址傳不過去(只傳index而已) : ※ 引述《feicsh.bbs@bbs.wretch.cc (飛)》之銘言: : : html <select> 在submit的時候一定是傳value, 不可能傳index. : : 一定是你哪裡寫錯了或想錯了。 : : 把你的code post 上來看看。 -- 我主修物理 選修計概 副修離散 唉.....三修國文 -- ╭──── Origin:<不良牛牧場> bbs.badcow.com.tw (210.200.247.200)─────╮ Welcome to SimFarm BBS -- From : [59.112.98.109] ◣◣◢ ◢◢不良牛免費撥接→電話:40586000→帳號:zoo→密碼:zoo ◣◣─╯
文章代碼(AID): #14ftPp00 (java)
討論串 (同標題文章)
文章代碼(AID): #14ftPp00 (java)