Results 1 to 3 of 3
  1. #1
    sukanya is offline Member
    Join Date
    Mar 2012
    Rep Power

    Default 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="">
    <script language="JavaScript">
    function validation()
    var a = document.form.ltype.value;
    if(a=="Marriage Leave")
    else if(b=="Special Leave")
    <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>

    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);
    <table width="549">
    <td width="549" height="24" background="/images/img02.jpg"><font color="#FFFFFF" size="4">Applicant</font></td>
    <td height="37" class="paragraping">StaffCode</td>
    <td>&nbsp;&nbsp;&nbsp;<input name="name" TYPE="text" class="texta1" value="<%out.println(rs.getString("staffcode"));%> "></td>
    <td height="37" class="paragraping">Name</td>
    <td>&nbsp;&nbsp;&nbsp;<input name="name" TYPE="text" class="texta1" value="<%out.println(rs.getString("name"));%>"></td>
    <td height="37" class="paragraping">Designation</td>
    <td>&nbsp;&nbsp;&nbsp;<input name="designation" TYPE="text" value=" <%out.println(rs.getString("designation"));%>">
    <td height="37" class="paragraping">Department</td>
    <td>&nbsp;&nbsp;&nbsp;<input name="department" TYPE="text" value="<%out.println(rs.getString("department"));% >"></td>
    <td height="37" class="paragraping">DOJ</td>
    <td>&nbsp;&nbsp;&nbsp;<input name="doj" TYPE="text" class="texta1" value="<%out.println(rs.getString("doj"));%>"></td>
    catch(Exception e)

    thanks in advance.
    Last edited by sukanya; 04-08-2012 at 05:26 AM.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: event does not occur

    Look around the forum FAQs and discover how to post code so that it retains its formatting.

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power

    Default Re: event does not occur

    This is a Javascript question.
    Yes, you have Java in your JSP (which should be in a servlet), but the question is about your Javascript event.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Error occur while installing Eclipse
    By samantasmita in forum Eclipse
    Replies: 1
    Last Post: 01-05-2012, 03:24 PM
  2. Replies: 1
    Last Post: 07-19-2011, 05:20 PM
  3. checking for an event during an event
    By infinity in forum AWT / Swing
    Replies: 22
    Last Post: 04-09-2009, 02:08 AM
  4. Key event
    By ivvgangadhar in forum Threads and Synchronization
    Replies: 1
    Last Post: 12-11-2008, 10:27 AM
  5. Event
    By nt5515 in forum New To Java
    Replies: 0
    Last Post: 02-15-2008, 05:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts