malayasthana 0 Newbie Poster

hello guys., i severely need your help . in the following code i want to transfer the value of rowIndex to next jsp page and want to get it there and print it. please tell me how it could be done.

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>search Result</title>
    </head>
        <script type="text/javascript">
            function function1(t){
            alert(t.parentNode.rowIndex);
            var rowIndex1=t.parentNode.rowIndex;

                    document.getElementById("data1").setAttribute("data1", rowIndex1);
            document.data1.value = rowIndex1;
            document.getElementById("abc").submit();
            //document.data.submit();
            }
        </script>
    <form id="abc"action="modify.jsp" method="get">
        <input type="hidden" id="data1" name="data1" value="">
    </form>
    <body><center>
        <table align="center">
             <div align ="top">
                <table>
                    <tr>
                        <td>
                        <p><img src="../drsound.jpg" alt="image can't be displayed" width="600" height="100"/></p>
                         </td>
                    </tr>
                </table>
            </div>
        </table><br><br>
       </center>
        <center>
        <table  cellpadding="30">
            <tr>
                <th>Title</th>
                <th>Artist</th>
                <th>Time</th>
                <th>Year</th>
                <th>Label</th>
                <th>Publishing</th>
                <th>Topic</th>
                <th>Action</th>
            </tr>                      
             <%
                ArrayList beanlist= new ArrayList();
                ResultSet resultSetSearchTableDisplay;
                 if (request.getParameter("title") == "" && request.getParameter("artist") == "" && request.getParameter("time") == ""
                        && request.getParameter("year") == "" && request.getParameter("label") == "" && request.getParameter("publishing") == ""
                        && request.getParameter("topic") == "") {
                          beanlist = MusiclibraryDBconnect.getConnection().getDataFromTrackDatabase();
                          for(int i=0; i<beanlist.size(); i++){
                               musicBean searchResultBean = (musicBean)beanlist.get(i); %>
                          <tr>
                              <td><a href="javascript:function1(this)" class="clickable"><%=searchResultBean.getTitle()%></a></td>
                              <td><a href="javascript:function1(this)" class="clickable"><%=searchResultBean.getArtist()%></a></td>
                              <td><a href="javascript:function1(this)" class="clickable"><%=searchResultBean.getTime()%></a></td>
                              <td><a href="javascript:function1(this)" class="clickable"><%=searchResultBean.getYear()%></a></td>
                              <td><a href="javascript:function1(this)" class="clickable"><%=searchResultBean.getLabel()%></a></td>
                              <td><a href="javascript:function1(this)" class="clickable"><%=searchResultBean.getPublishers()%></a></td>
                              <td><a href="javascript:function1(this)" class="clickable"><%=searchResultBean.getTopic()%></a></td>
                              <td><button type="button" onclick="deleterecord()">Delete</button> </td>
                          </tr>
                          <%}

in this when a table row is clicked then it is taking the value of row and i have to transfer it to next .jsp// please tell what wrong have i done and whats the correction.
your own codes are welcome.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.