First.jsp ------------------ <jsp:usebean id="db" class="db.dbClass" scope=session/> <html> <body> <form action="MyAction.jsp" method="post"> <% ResultSet rs=db.executeQuery("select no,name from mytable"); while(rs.next()) {%> <input type=checkbox value=<%=rs.getString(1)%> onclick=callJs(< %=rs.getString(1)%>) > <%} %> <input type=text name=displaydatetxt id=displaydate/> </form> <script> function callJs(arg1) { var url="Ajax.jsp"; new Ajax.Request(url, {asynchronous: true,method: "post",parameters: "ajaxrefno=" +arg1, onSuccess: function(request) { $('displaydatetxt').value =request.responseText; }, onFailure: function(request) { $('displaydatetxt').value =request.responseText;} }); } </script> </body> </html> ******************************** Now the Ajax.jsp <html> <body><% if(request.getParameter("ajaxrefno")!=null) { ResultSet rs=db.executeQuery("select mydate from display_table where number='"+request.getParameter("ajaxrefno")+"' "); if(rs.next) { out.print(rs.getString(1)); } }
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---