[問題] radio自動送出

看板Web_Design作者 (一隻羊)時間14年前 (2009/08/08 06:53), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/2 (看更多)
請問一下要怎麼做出使用者點了radio 就自動轉向另一個頁面?(不用按送出鈕) ○1 ○2 ○3 ○4 ○5 我查了RADIO似乎沒有ˊ ˋ 謝謝 以下是我找到的寫法 不知道有沒有其他的方法? <script> var url = new Array(3); url[0] = "http://1.tw"; url[1] = "http://2.tw"; function goto(i) { location = url[i]; } </script> </head> <body> <form method="post" action="" style="height: 158px"> <input type="radio" onclick="goto(0)" name="1" value="1" />網頁1 <input type="radio" onclick="goto(1)" name="1" value="2"/>網頁2 </form> </body> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.199.107 ※ 編輯: taipingeric 來自: 140.112.199.107 (08/08 07:02)

08/08 07:28, , 1F
onclick="document.location.href='http://blah.tw'"
08/08 07:28, 1F

08/08 12:51, , 2F
謝謝
08/08 12:51, 2F
文章代碼(AID): #1AVB2394 (Web_Design)
文章代碼(AID): #1AVB2394 (Web_Design)