开发者

access buttons from jsp

开发者 https://www.devze.com 2023-01-26 14:36 出处:网络
i\'m getting the value s from database and in while loop i\'m writing the following code which is written inside a form and on action calls another jsp page

i'm getting the value s from database and in while loop i'm writing the following code which is written inside a form and on action calls another jsp page

    <TD> <%= set.getInt(1) %> </TD>

    <TD><%= set.getString(2) %> </TD>

    <TD><%= set.getString(3) %> </TD>

     <TD> <%= set.getString(4) %> </TD>

    <TD><%= set.getString(5) %> </TD>   



    <TD> <%

String s = set.getString(4);
                 if(s.equals("Request Recieved"))
                { %>
                <input type="hidden" id= "i1" name="h1" value="Request Recieved" />
                    <input type="submit"  id="i1" value="Submit" /> 开发者_运维问答

Thus i'll get a few rows and respective buttons. now my requirement is when i click a particular button on the jsp page only the value related to that button should only be updated to database. but i'm unable to relate the button with its respective value.


Either give the button a specific name, so that you can check if its request parameter doesn't return null (cumbersome), or just put each row in its own <form> where the row ID is set as hidden input value (recommended).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号