라디오 버튼을 클릭하면 id 값을 표시하지만 라디오 버튼을 클릭하면 정의되지 않은 메시지가 표시됩니다. 왜 그런 일이 일어나고있는거야?라디오 버튼을 클릭하면 jsp에서 정의되지 않은 메시지가 나타납니다. 이슈가 뭐야?
<script language="javascript>
function openSubrurbicPopup(){
alert(document.frmRubric.rubricid.value);}
</script>
<%
try{
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost/database", "root", "admin");
String sql = "select * from table where parentid='0'";
rs = con.createStatement().executeQuery(sql);
%>
<form name="frmRubric" method="post" >
<% while(rs.next()){
String id = rs.getString("id");
%>
<input type="radio" name="radio" onclick="openSubrurbicPopup()" />
<input type="text" name="rubricid" value="<%=id%>" /><br>
<%}%>
</form>
<%}catch(Exception e){
out.println(e.getMessage());
e.printStackTrace();
}
%>
</body></html>
http://stackoverflow.com/questions/3927250/unable-to-get-form-elements-by-using-form-name-in-javascript – Garbage