Forum: Rails Spinoffs (closed, excessive spam) Formating Date Field

12e5af8b643a158e46f887337f289e35?d=identicon&s=25 raku (Guest)
on 2008-06-17 14:20
(Received via mailing list)
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));
}
}
969b153010f69ec07458fa1d9e8a413b?d=identicon&s=25 Diodeus (Guest)
on 2008-06-18 19:57
(Received via mailing list)
I use this for all my date inputs:
http://www.frequency-decoder.com/2006/10/02/unobtr...
This topic is locked and can not be replied to.