I really can't see what's wrong in my code... the submit() onChange doesn't work..
I've tried..
it doesn't work...
this one work on my test page.. but it didn't work when i embed it on my project..
here is the complete code of my webApp.. I'll truly appreciate and be grateful of whatever help you'll be able to give.. thanks in advance...
<%@ page import="java.sq l.*" %>
<%@ page import="java.io .*" %>
<%@ page import ="java.util. *" %>
<%@ page import="java.te xt.*" %>
<%@page import ="java.lang. *" %>
[HTML]<html>
<head>
<LINK href="Admin/css/format.css" type="text/css" rel="stylesheet ">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WBITE Index</title>
<table width="100%" bgcolor="#FFFFF F">
<tr> <td height="10"></td></tr>
<tr>
<td width="159" height="45" align="right">
<img src="Admin/Images/logor.gif" width="159" height="45" /></td>
<td width="100%" valign="bottom" align="left">
<img align="bottom" src="Admin/Images/header.gif" alt="header" />
</td>
</tr>
<tr>
<td colspan="2" align="center" width="100%" background="Adm in/Images/lineB.gif" height="23" valign="top">
</td>
</tr>
</table>
<script language="Javas cript" type="text/javascript">
function matchPassword(p assword,otherpa ssword)
{
document.getEle mentById("passw ord_match_statu s").style.displ ay="";
if (password == otherpassword)
{
document.getEle mentById("passw ord_match_statu s").style.displ ay="<img src="../Images/ImageButtons/approve_ovr.gif "> Passwords Match";
}
else {
document.getEle mentById("passw ord_match_statu s").style.displ ay = "<img src="../Images/ImageButtons/disapprove_ovr. gif"> Passwords Do Not Match";
}
}
function reloadForm(){
document.regExa minee.action = "regExaminee.js p";
document.regExa minee.submit();
}
function populate(){
ddlTestCenter = document.getEle mentById("regEx aminee");
ddlTestCenter = "ddlExamSchedul e.do";
ddlTestCenter.s ubmit();
}
</script>
</head>
<body>
<!--header-->
<table width="100%">
<!--DWLayoutTable-->
<tr>
<td width="400" rowspan="4" align="center" valign="top">
<table width="400" cellpadding="3" cellspacing="0" bgcolor="#FEE9C B">
<input type="hidden" name="_submitte d" value="1">
<input type="hidden" name="next" value="/">
<input type="hidden" name="tzoffset" value="">
<tr>
<td colspan="5" valign="top" bgcolor="#FBEFE F" align="center" width="400">
<table width="400" bgcolor="#FEE9C B" border="2">
<!--DWLayoutTable-->
<tr>
<td height="20" colspan="5" align="left" style="color:#F FFFFF; font-weight:bold; background-color:#641A00"> Register Examinee </td>
</tr>
<tr>
<td align="center" valign="top" width="400" >
<form name="regExamin ee" method="post" action="regExam inee.jsp" >
<!--Start of Registration Form-->
<%
String testCenter = request.getPara meter("ddlTestC enter");
String driver = "com.mysql.jdbc .Driver";
String url = "jdbc:mysql ://192.168.0.9:330 6/WBITE?user=root ";
Connection con = null;
ResultSet rs = null;
ResultSet rs2 = null;
Statement stmt = null;
con = DriverManager.g etConnection(ur l);
stmt = con.createState ment();
%>
<table cellpadding="3" bgcolor="#FEF9E 9" width="400">
<tr>
<td style="text-align:right!imp ortant;width:13 0px">Test Center:</td>
<td>
<input type="hidden" name="hiddenopt " value="secret">
<select name="ddlTestCe nter" id="ddlTestCent er" style="width:18 0px" onChange="this. form.submit();" >
<option value="javascri pt:void(0)">- Test Center -</option>
<%
try {
rs = stmt.executeQue ry("CALL `WBITE`.`uspSel ectTestCenter`( )");
while (rs.next()) {
if(testCenter == rs.getString(1) ){
%>
<option name="ddlTestCe nterOption" id="ddlTestCent erOption" value="<%=rs.ge tString(1)%>" selected="selec ted"> <%=rs.getString (1)+" ("+ rs.getString(2) +")"%></option>
<%
}
else
{
%>
<option name="ddlTestCe nterOption" id="ddlTestCent erOption" value="<%=rs.ge tString(1)%>"> <%=rs.getString (1)+" ("+ rs.getString(2) +")"%></option>
<%
}
}
} catch (Exception e) {
System.out.prin tln(e);
}
%>
</select>
</td>
</tr>
<tr>
<td style="text-align:right!imp ortant;width:13 0px">Exam Schedule:</td>
<td>
<select name="ddlExamSc hedule" id="ddlExamSche dule" style="width:18 0px"" >
<option value="">- Exam Schedule -</option>
<%
if (testCenter!=nu ll)
{
try {
rs2 = stmt.executeQue ry("SELECT * FROM WBITE.examSched ule e where TestCenterName= '"+testCenter+" ';");
while (rs2.next()) {
%>
<option name="ddlExamSc hedule" id="ddlExamSche dule" value="<%=rs.ge tString(5)%>"> <%=rs.getString (2)+" ("+ rs.getString(3) +"-"+rs.getString( 4)+")"%></option>
<%}
} catch (Exception e) {
System.out.prin tln(e);
}
} %>
</select>
</td>
</tr>
<tr>
<td style="text-align:right!imp ortant;width:15 0px">Username: </td>
<td>
<input type="text" name="txtUserNa me" id="reg_usernam e" value="" maxlength="100" style="width:18 0px">
</td>
</tr>
<tr>
<td style="text-align:right !important;">Pa ssword:</td>
<td>
<input type="password" name="txtPasswo rd" id="txtPassword " value="" maxlength="17" style="width:18 0px"></td>
</tr>
<tr>
<td style="text-align:right !important;">Re-enter password: </td>
<td width="227" >
<input style="width:18 0px" type="password" name="txtPasswo rd2" id="txtPassword 2" maxlength="17" onKeyUp="match( this.value,txtP assword.value) " >
</td>
</tr>
<tr id="rowPassword " style="display: none">
<td> </td>
<td><span id="password_ma tch_status"><im g src="../Images/ImageButtons/disapprove_ovr. gif" alt="Does Not Match" width="35" height="25"> Passwords Do Not Match</span></td>
</tr>
<tr>
<td style="text-align:right !important;">Fi rst Name:</td>
<td><input style="width:18 0px" name="txtFirstN ame" maxlength="15" value="" type="text" onFocus="docume nt.getElementBy Id("rowPassword ").style.displa y=''"></td>
</tr>
<tr>
<td style="text-align:right !important;">La st Name:</td>
<td><input type="text" name="txtContac tNum" id="txtContactN um" value="" maxlength="100" style="width:18 0px" > </td>
</tr>
<tr>
<td style="text-align:right!imp ortant;width:13 0px">Contact Number:</td>
<td>
<input type="text" name="txtContac tNum" id="txtContactN um" value="" maxlength="100" style="width:18 0px" > </td>
</tr>
<tr>
<td style="text-align:right!imp ortant;width:13 0px">Email Address:</td>
<td>
<input type="text" name="txtEmailA dd" id="txtEmailAdd " value="" maxlength="100" style="width:18 0px" > </td>
</tr>
<tr>
<td style="text-align:right !important;">Ge nder:</td>
<td valign="middle" >
<input name="rdioGende r" type="radio" value="Male" checked>Male
<input name="rdioGende r" type="radio" value="Female"> Female
</td>
</tr>
<tr><td height="17"></td></tr>
<tr>
<td></td>
<td colspan="2">
<input type="submit" name="submit" value="Register Examinee">
</td>
</tr>
</table> <!--END of Registration Form-->
</form>
</td>
</tr>
<!--HOLDS the LARGEST ROW contains both forms-->
</table>
</td>
</tr>
</table>
<!--DIV: Boxcontent -->
</td>
</tr>
<tr>
<td height="5"></td>
</tr>
</table>
</body>
</html>[/HTML]
I've tried..
Code:
<select name="ddlTestCenter" id="ddlTestCenter" style="width:180px" onChange="this.form.submit();">
Code:
<input type="hidden" name="hiddenopt" value="secret"> <select name="list" onChange="document.forms['try'].submit();">
here is the complete code of my webApp.. I'll truly appreciate and be grateful of whatever help you'll be able to give.. thanks in advance...
<%@ page import="java.sq l.*" %>
<%@ page import="java.io .*" %>
<%@ page import ="java.util. *" %>
<%@ page import="java.te xt.*" %>
<%@page import ="java.lang. *" %>
[HTML]<html>
<head>
<LINK href="Admin/css/format.css" type="text/css" rel="stylesheet ">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WBITE Index</title>
<table width="100%" bgcolor="#FFFFF F">
<tr> <td height="10"></td></tr>
<tr>
<td width="159" height="45" align="right">
<img src="Admin/Images/logor.gif" width="159" height="45" /></td>
<td width="100%" valign="bottom" align="left">
<img align="bottom" src="Admin/Images/header.gif" alt="header" />
</td>
</tr>
<tr>
<td colspan="2" align="center" width="100%" background="Adm in/Images/lineB.gif" height="23" valign="top">
</td>
</tr>
</table>
<script language="Javas cript" type="text/javascript">
function matchPassword(p assword,otherpa ssword)
{
document.getEle mentById("passw ord_match_statu s").style.displ ay="";
if (password == otherpassword)
{
document.getEle mentById("passw ord_match_statu s").style.displ ay="<img src="../Images/ImageButtons/approve_ovr.gif "> Passwords Match";
}
else {
document.getEle mentById("passw ord_match_statu s").style.displ ay = "<img src="../Images/ImageButtons/disapprove_ovr. gif"> Passwords Do Not Match";
}
}
function reloadForm(){
document.regExa minee.action = "regExaminee.js p";
document.regExa minee.submit();
}
function populate(){
ddlTestCenter = document.getEle mentById("regEx aminee");
ddlTestCenter = "ddlExamSchedul e.do";
ddlTestCenter.s ubmit();
}
</script>
</head>
<body>
<!--header-->
<table width="100%">
<!--DWLayoutTable-->
<tr>
<td width="400" rowspan="4" align="center" valign="top">
<table width="400" cellpadding="3" cellspacing="0" bgcolor="#FEE9C B">
<input type="hidden" name="_submitte d" value="1">
<input type="hidden" name="next" value="/">
<input type="hidden" name="tzoffset" value="">
<tr>
<td colspan="5" valign="top" bgcolor="#FBEFE F" align="center" width="400">
<table width="400" bgcolor="#FEE9C B" border="2">
<!--DWLayoutTable-->
<tr>
<td height="20" colspan="5" align="left" style="color:#F FFFFF; font-weight:bold; background-color:#641A00"> Register Examinee </td>
</tr>
<tr>
<td align="center" valign="top" width="400" >
<form name="regExamin ee" method="post" action="regExam inee.jsp" >
<!--Start of Registration Form-->
<%
String testCenter = request.getPara meter("ddlTestC enter");
String driver = "com.mysql.jdbc .Driver";
String url = "jdbc:mysql ://192.168.0.9:330 6/WBITE?user=root ";
Connection con = null;
ResultSet rs = null;
ResultSet rs2 = null;
Statement stmt = null;
con = DriverManager.g etConnection(ur l);
stmt = con.createState ment();
%>
<table cellpadding="3" bgcolor="#FEF9E 9" width="400">
<tr>
<td style="text-align:right!imp ortant;width:13 0px">Test Center:</td>
<td>
<input type="hidden" name="hiddenopt " value="secret">
<select name="ddlTestCe nter" id="ddlTestCent er" style="width:18 0px" onChange="this. form.submit();" >
<option value="javascri pt:void(0)">- Test Center -</option>
<%
try {
rs = stmt.executeQue ry("CALL `WBITE`.`uspSel ectTestCenter`( )");
while (rs.next()) {
if(testCenter == rs.getString(1) ){
%>
<option name="ddlTestCe nterOption" id="ddlTestCent erOption" value="<%=rs.ge tString(1)%>" selected="selec ted"> <%=rs.getString (1)+" ("+ rs.getString(2) +")"%></option>
<%
}
else
{
%>
<option name="ddlTestCe nterOption" id="ddlTestCent erOption" value="<%=rs.ge tString(1)%>"> <%=rs.getString (1)+" ("+ rs.getString(2) +")"%></option>
<%
}
}
} catch (Exception e) {
System.out.prin tln(e);
}
%>
</select>
</td>
</tr>
<tr>
<td style="text-align:right!imp ortant;width:13 0px">Exam Schedule:</td>
<td>
<select name="ddlExamSc hedule" id="ddlExamSche dule" style="width:18 0px"" >
<option value="">- Exam Schedule -</option>
<%
if (testCenter!=nu ll)
{
try {
rs2 = stmt.executeQue ry("SELECT * FROM WBITE.examSched ule e where TestCenterName= '"+testCenter+" ';");
while (rs2.next()) {
%>
<option name="ddlExamSc hedule" id="ddlExamSche dule" value="<%=rs.ge tString(5)%>"> <%=rs.getString (2)+" ("+ rs.getString(3) +"-"+rs.getString( 4)+")"%></option>
<%}
} catch (Exception e) {
System.out.prin tln(e);
}
} %>
</select>
</td>
</tr>
<tr>
<td style="text-align:right!imp ortant;width:15 0px">Username: </td>
<td>
<input type="text" name="txtUserNa me" id="reg_usernam e" value="" maxlength="100" style="width:18 0px">
</td>
</tr>
<tr>
<td style="text-align:right !important;">Pa ssword:</td>
<td>
<input type="password" name="txtPasswo rd" id="txtPassword " value="" maxlength="17" style="width:18 0px"></td>
</tr>
<tr>
<td style="text-align:right !important;">Re-enter password: </td>
<td width="227" >
<input style="width:18 0px" type="password" name="txtPasswo rd2" id="txtPassword 2" maxlength="17" onKeyUp="match( this.value,txtP assword.value) " >
</td>
</tr>
<tr id="rowPassword " style="display: none">
<td> </td>
<td><span id="password_ma tch_status"><im g src="../Images/ImageButtons/disapprove_ovr. gif" alt="Does Not Match" width="35" height="25"> Passwords Do Not Match</span></td>
</tr>
<tr>
<td style="text-align:right !important;">Fi rst Name:</td>
<td><input style="width:18 0px" name="txtFirstN ame" maxlength="15" value="" type="text" onFocus="docume nt.getElementBy Id("rowPassword ").style.displa y=''"></td>
</tr>
<tr>
<td style="text-align:right !important;">La st Name:</td>
<td><input type="text" name="txtContac tNum" id="txtContactN um" value="" maxlength="100" style="width:18 0px" > </td>
</tr>
<tr>
<td style="text-align:right!imp ortant;width:13 0px">Contact Number:</td>
<td>
<input type="text" name="txtContac tNum" id="txtContactN um" value="" maxlength="100" style="width:18 0px" > </td>
</tr>
<tr>
<td style="text-align:right!imp ortant;width:13 0px">Email Address:</td>
<td>
<input type="text" name="txtEmailA dd" id="txtEmailAdd " value="" maxlength="100" style="width:18 0px" > </td>
</tr>
<tr>
<td style="text-align:right !important;">Ge nder:</td>
<td valign="middle" >
<input name="rdioGende r" type="radio" value="Male" checked>Male
<input name="rdioGende r" type="radio" value="Female"> Female
</td>
</tr>
<tr><td height="17"></td></tr>
<tr>
<td></td>
<td colspan="2">
<input type="submit" name="submit" value="Register Examinee">
</td>
</tr>
</table> <!--END of Registration Form-->
</form>
</td>
</tr>
<!--HOLDS the LARGEST ROW contains both forms-->
</table>
</td>
</tr>
</table>
<!--DIV: Boxcontent -->
</td>
</tr>
<tr>
<td height="5"></td>
</tr>
</table>
</body>
</html>[/HTML]
Comment