JS isnt called by firefox but is in IE why?
This is the main parts of the page, i dont really understnad why but the button has no function, it doest even appear to attemp to call the JS at all. and i dont understand what may cause this...
<%@ page import="java.util.*;" %>
<%@ page contentType="text/html; charset=ISO-8859-5" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
<head>
<title>Interactive Experience Database - Search</title>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="style.css">
</head>
<SCRIPT LANGUAGE="JavaScript" SRC="main.js">
</SCRIPT>
<body>
<FORM name="myForm">
... the page is full of information butthis is the button:
<INPUT TYPE=BUTTON VALUE="Generate" onclick="generate()">
</form>
</body>
</html>
the js file:
function generate()
{
if(document.getElementById("EmployeeName2").selectedIndex =="0")
{
window.alert('You must select a Employee Name');
return;
}
if(document.getElementById("templates").selectedIndex =="0")
{
window.alert('You must select a Template');
return;
}
else
{
document.myForm.action="cvgeneration.jsp";
document.myForm.submit();
}
}
[2294 byte] By [
h1400046a] at [2007-11-26 21:36:38]

# 5
[nobr]<%@ page import="java.util.*;" %>
<%@ page contentType="text/html; charset=ISO-8859-5" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
<head>
<title>Interactive Experience Database - Search</title>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="style.css">
<SCRIPT LANGUAGE="JavaScript" SRC="main.js">
</SCRIPT>
</head>
<%
String ename = request.getParameter( "EmployeeName");
session.setAttribute( "ename", ename);
String sname = request.getParameter( "SkillName" );
session.setAttribute( "sname", sname );
String yexp = request.getParameter ("yearsExp");
if (yexp != null)
{
if (yexp =="")
{
session.setAttribute( "yexp", 0);
}
else
{
boolean check = true;
for(int i=0; check && (i<yexp.length()); i++)
{
check = Character.isDigit(yexp.charAt(i));
}
if(!check)
{
session.setAttribute( "yexp", 0);
}
else
{
double yearsexp = Double.parseDouble(request.getParameter("yearsExp"));
session.setAttribute( "yexp", yearsexp);
}
}
}
else
{
session.setAttribute( "yexp", 0);
}
%>
<body>
<FORM name="myForm">
<table>
<tr>
<td width=10%>
<img src="http://localhost:8080/Experience/logo.gif" alt="Company">
</td>
</tr>
</table>
<h2> Main Page </h2>
<A href="http://localhost:8080/Experience/help.jsp">Help</A>
<br>
<A href="http://localhost:8080/Experience/Updates/update.jsp">Update</A>
<br> </br>
<table class="width">
<tr border-left-width:1px; class="heading">
<td >
<div id="largetableheader">
<font>
<b>
Reports Generation Tool
</b>
</font>
<div>
</td>
<td class="borderright">
</td>
<td width=10%>
</td>
<td>
<div id="largetableheader">
<font>
<b>
CV Generation Tool
</b>
</font>
</div>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td class="borderright">
</td>
</tr>
<tr>
<td>
Employee Name:
</td>
<td class="borderright">
<jsp:useBean id="employee" class="com.Database.Employee" scope="page">
</jsp:useBean>
<select name="EmployeeName">
<option> Please Select... </option>
<c:forEach var="emp" items="${employee.employees}">
<c:choose>
<c:when test="${emp.ename == sessionScope.ename }">
<option selected="selected" name="<c:out value="${emp.forename}"/> <c:out value="${emp.surname}"/>">
<c:out value="${emp.forename}"/> <c:out value="${emp.surname}"/>
</option>
</c:when>
<c:otherwise>
<option name="<c:out value="${emp.forename}"/> <c:out value="${emp.surname}"/>">
<c:out value="${emp.forename}"/> <c:out value="${emp.surname}"/>
</option>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
</td>
<td>
</td>
<td>
Employee Name:
</td>
<td >
<select name="EmployeeName2">
<option> Please Select... </option>
<c:forEach var="emp" items="${employee.employees}">
<option name="<c:out value="${emp.forename}"/> <c:out value="${emp.surname}"/>">
<c:out value="${emp.forename}"/> <c:out value="${emp.surname}"/>
</option>
</c:forEach>
</select>
</td>
<td>
</td>
</tr>
<tr>
<td>
Skill Name:
</td>
<td class="borderright">
<jsp:useBean id="skill" class="com.Database.Skill" scope="page">
</jsp:useBean>
<select name="SkillName">
<option> Please Select... </option>
<c:forEach var="s" items="${skill.skills}">
<c:choose>
<c:when test="${s.skillname == sessionScope.sname }">
<option selected="selected" name="<c:out value="${s.skillname}"/> ">
<c:out value="${s.skillname}"/>
</option>
</c:when>
<c:otherwise>
<option name="<c:out value="${s.skillname}"/> ">
<c:out value="${s.skillname}"/>
</option>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
</td>
<td >
</td>
<td>
Template:
</td>
<td>
<select name="templates">
<option> Please Select... </option>
<option>Standard Resume</option>
<option>Professional Resume</option>
<option>Fully Technical Resume</option>
<option>Skills Resume</option>
</select>
</td>
<td>
</td>
</tr>
<tr>
<td>
Years Experience:
</td>
<td class="borderright">
<input type="text" name="yearsExp" value = "<%= session.getAttribute( "yexp" ) %>"/>
</td>
<td >
</td>
<td>
Output To:
</td>
<td ALIGN = LEFT>
<input type="radio" name="outputtype" value="Browser" checked="checked">Browser<br>
<input type="radio" name="outputtype" value="PDF"/>PDF<br>
</td>
</tr>
<tr>
<td>
</td>
<td class="borderright">
<INPUT TYPE=SUBMIT VALUE="Search">
</td>
<td>
</td>
<td>
</td>
<td>
<INPUT TYPE=button VALUE="Generate" onclick="generate()">
</td>
<td>
</td>
</tr>
</table>
<br> </br>
<table class="heading">
<tr>
<td>
<font>
<b> Report: Employee Skill Details: </b>
</font>
</td>
<tr>
</table>
<br> </br>
<jsp:useBean id="empskill" class="com.Database.EmployeeSkill" scope="page">
<jsp:setProperty name="empskill" property="ename" value="<%= session.getAttribute( "ename" ) %>"/>
<jsp:setProperty name="empskill" property="skillname" value="<%= session.getAttribute( "sname" ) %>"/>
<jsp:setProperty name="empskill" property="yearsexperience" value="<%= session.getAttribute( "yexp" ) %>"/>
</jsp:useBean>
<div id="report">
<table>
<tr class="reportheading">
<td>
<b>Employee Name</b>
</td>
<td>
<b>Skill Name</b>
</td>
<td>
<b>Skill Level</b>
</td>
<td>
<b>Years Experience</b>
</td>
</tr>
<c:forEach var="empskill" items="${empskill.report}">
<tr>
<td>
<c:out value="${empskill.ename}"/>
</td>
<td>
<c:out value="${empskill.skillname}"/>
</td>
<td>
<c:out value="${empskill.skilllevel}"/>
</td>
<td>
<c:out value="${empskill.yearsexperience}"/>
</td>
</tr>
</c:forEach>
</table>
</div>
</form>
</body>
</html>
Message was edited by:
h1400046[/nobr]