JSPのテーブルで、「行」をラジオボタンで選択して削除ボタンで消す方法について
只今勉強中の初心者です。
テーブルの「行」をボタンで消すやり方は下記のようにできたのですが、
ラジオボタンで選択して「行」を消す方法がわかりません。
よろしくお願いします。
<body> <h2>社員一覧</h2> <form> <table border="1" > <tr bgcolor="#87ceeb"> <th></th> <th>社員コード</th> <th>氏名</th> <th>氏名カナ</th> <th>性別</th> <th>役職名</th> <th>所属部署名</th> <th>在職情報</th> </tr> <% List<Tableclass> list=(List<Tableclass>)request.getAttribute("list"); for(int i=0; i<list.size(); i++){ Tableclass Tableclass = list.get(i); %> <tr> <% if (i == 0) { %> <td><label><input type="radio" name="radiobuttn"value="s_id" checked></label> <% } else { %> <td><label><input type="radio" name="radiobuttn"value="s_id"></label> <% } %> <td><%=Tableclass.getS_id() %> <td><%=Tableclass.getL_name() %> <%=Tableclass.getF_name() %></td> <td><%=Tableclass.getL_name_kana() %> <%=Tableclass.getF_name_kana() %></td> <td><%=Tableclass.getSex() %> <td><%=Tableclass.getClas() %> <td><%=Tableclass.getDepart_name() %> <td><%=Tableclass.getRetired() %> <% } %> <script type="text/javascript"> function remove_row(o){ var TR = o.parentNode.parentNode; TR.parentNode.deleteRow(TR.sectionRowIndex); } </script> <td><input type="button" value="削除" onclick="remove_row(this)"></td> </table> <br/> <input type="submit" value="削除" value="s_id"> <input type="submit" value="登録"> <input type="submit" value="更新"> <input type="submit" value="戻る"> </form> </body>
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2017/07/13 07:47
2017/07/13 12:24