Results 1 to 3 of 3
Thread: event does not occur
- 04-07-2012, 08:34 AM #1
Member
- Join Date
- Mar 2012
- Posts
- 5
- Rep Power
- 0
event does not occur
I am designing a leave request form.My logic is While selecting the leave type it goes to another form(eg: if marriage leave is selected it goes to marriage.jsp page).But it does not go to next page.
Please anyone help to fix the problem.
My code is below.
<%@ page import="java.sql.*,databaseconnection.*"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="JavaScript">
function validation()
{
var a = document.form.ltype.value;
if(a=="Marriage Leave")
{
location.href="marriage.jsp";
}
else if(b=="Special Leave")
{
location.href="special.jsp"
}
}
</script>
</head>
<body>
<form name="form" action="empleaveinsert.jsp" method="post">
<p align="right" height="37" class="paragraping">Type of Leave:
<select name="leavtype" class="texta1" onblur="return validation()">//this event does not occur
<option name="select1"><- - - SELECT - - - ></option>
<option name="Casual Leave">Casual Leave</option>
<option name="Privilege Leave">Privilege Leave</option>
<option name="Marriage Leave">Marriage Leave</option>
<option name="Maternity Leave">Maternity Leave</option>
<option name="Special Leave">Special Leave</option>
</select>
</p>
<%
try
{
Connection con=databasecon.getconnection();
Statement st=con.createStatement();
String s=(String)session.getAttribute("staffcode");
String sql="select * from staff where staffcode ='"+s+"'";
ResultSet rs=st.executeQuery(sql);
while(rs.next())
{
%>
<table width="549">
<tr>
<td width="549" height="24" background="/images/img02.jpg"><font color="#FFFFFF" size="4">Applicant</font></td>
</tr>
</table>
<table>
<tr>
<td height="37" class="paragraping">StaffCode</td>
<td> <input name="name" TYPE="text" class="texta1" value="<%out.println(rs.getString("staffcode"));%> "></td>
</tr>
<tr>
<td height="37" class="paragraping">Name</td>
<td> <input name="name" TYPE="text" class="texta1" value="<%out.println(rs.getString("name"));%>"></td>
</tr>
<tr>
<td height="37" class="paragraping">Designation</td>
<td> <input name="designation" TYPE="text" value=" <%out.println(rs.getString("designation"));%>">
</td>
</tr>
<tr>
<td height="37" class="paragraping">Department</td>
<td> <input name="department" TYPE="text" value="<%out.println(rs.getString("department"));% >"></td>
</tr>
<tr>
<td height="37" class="paragraping">DOJ</td>
<td> <input name="doj" TYPE="text" class="texta1" value="<%out.println(rs.getString("doj"));%>"></td>
</tr>
</table>
</form>
<%
}
st.close();
con.close();
}
catch(Exception e)
{
out.println(e);
}
%>
</body>
</html>
thanks in advance.Last edited by sukanya; 04-08-2012 at 04:26 AM.
- 04-07-2012, 09:48 AM #2
Re: event does not occur
Look around the forum FAQs and discover how to post code so that it retains its formatting.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 04-11-2012, 10:56 AM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Similar Threads
-
Error occur while installing Eclipse
By samantasmita in forum EclipseReplies: 1Last Post: 01-05-2012, 02:24 PM -
Problem occur while installing Groovy IDE in Ecllipse
By nirasiva in forum New To JavaReplies: 1Last Post: 07-19-2011, 04:20 PM -
checking for an event during an event
By infinity in forum AWT / SwingReplies: 22Last Post: 04-09-2009, 01:08 AM -
Key event
By ivvgangadhar in forum Threads and SynchronizationReplies: 1Last Post: 12-11-2008, 09:27 AM -
Event
By nt5515 in forum New To JavaReplies: 0Last Post: 02-15-2008, 04:44 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks