I've tried..
Expand|Select|Wrap|Line Numbers
- <select name="ddlTestCenter" id="ddlTestCenter" style="width:180px" onChange="this.form.submit();">
Expand|Select|Wrap|Line Numbers
- <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.sql.*" %>
<%@ page import="java.io.*" %>
<%@ page import ="java.util.*" %>
<%@ page import="java.text.*" %>
<%@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="#FFFFFF">
<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="Admin/Images/lineB.gif" height="23" valign="top">
</td>
</tr>
</table>
<script language="Javascript" type="text/javascript">
function matchPassword(password,otherpassword)
{
document.getElementById("password_match_status").s tyle.display="";
if (password == otherpassword)
{
document.getElementById("password_match_status").s tyle.display="<img src="../Images/ImageButtons/approve_ovr.gif"> Passwords Match";
}
else {
document.getElementById("password_match_status").s tyle.display = "<img src="../Images/ImageButtons/disapprove_ovr.gif"> Passwords Do Not Match";
}
}
function reloadForm(){
document.regExaminee.action = "regExaminee.jsp";
document.regExaminee.submit();
}
function populate(){
ddlTestCenter = document.getElementById("regExaminee");
ddlTestCenter = "ddlExamSchedule.do";
ddlTestCenter.submit();
}
</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="#FEE9CB">
<input type="hidden" name="_submitted" value="1">
<input type="hidden" name="next" value="/">
<input type="hidden" name="tzoffset" value="">
<tr>
<td colspan="5" valign="top" bgcolor="#FBEFEF" align="center" width="400">
<table width="400" bgcolor="#FEE9CB" border="2">
<!--DWLayoutTable-->
<tr>
<td height="20" colspan="5" align="left" style="color:#FFFFFF; font-weight:bold; background-color:#641A00">Register Examinee </td>
</tr>
<tr>
<td align="center" valign="top" width="400" >
<form name="regExaminee" method="post" action="regExaminee.jsp" >
<!--Start of Registration Form-->
<%
String testCenter = request.getParameter("ddlTestCenter");
String driver = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://192.168.0.9:3306/WBITE?user=root";
Connection con = null;
ResultSet rs = null;
ResultSet rs2 = null;
Statement stmt = null;
con = DriverManager.getConnection(url);
stmt = con.createStatement();
%>
<table cellpadding="3" bgcolor="#FEF9E9" width="400">
<tr>
<td style="text-align:right!important;width:130px">Test Center:</td>
<td>
<input type="hidden" name="hiddenopt" value="secret">
<select name="ddlTestCenter" id="ddlTestCenter" style="width:180px" onChange="this.form.submit();">
<option value="javascript:void(0)">- Test Center -</option>
<%
try {
rs = stmt.executeQuery("CALL `WBITE`.`uspSelectTestCenter`()");
while (rs.next()) {
if(testCenter == rs.getString(1)){
%>
<option name="ddlTestCenterOption" id="ddlTestCenterOption" value="<%=rs.getString(1)%>" selected="selected"> <%=rs.getString(1)+" ("+ rs.getString(2) +")"%></option>
<%
}
else
{
%>
<option name="ddlTestCenterOption" id="ddlTestCenterOption" value="<%=rs.getString(1)%>"> <%=rs.getString(1)+" ("+ rs.getString(2) +")"%></option>
<%
}
}
} catch (Exception e) {
System.out.println(e);
}
%>
</select>
</td>
</tr>
<tr>
<td style="text-align:right!important;width:130px">Exam Schedule:</td>
<td>
<select name="ddlExamSchedule" id="ddlExamSchedule" style="width:180px"" >
<option value="">- Exam Schedule -</option>
<%
if (testCenter!=null)
{
try {
rs2 = stmt.executeQuery("SELECT * FROM WBITE.examSchedule e where TestCenterName='"+testCenter+"';");
while (rs2.next()) {
%>
<option name="ddlExamSchedule" id="ddlExamSchedule" value="<%=rs.getString(5)%>"> <%=rs.getString(2)+" ("+ rs.getString(3)+"-"+rs.getString(4)+")"%></option>
<%}
} catch (Exception e) {
System.out.println(e);
}
} %>
</select>
</td>
</tr>
<tr>
<td style="text-align:right!important;width:150px">Username:</td>
<td>
<input type="text" name="txtUserName" id="reg_username" value="" maxlength="100" style="width:180px">
</td>
</tr>
<tr>
<td style="text-align:right !important;">Password:</td>
<td>
<input type="password" name="txtPassword" id="txtPassword" value="" maxlength="17" style="width:180px"></td>
</tr>
<tr>
<td style="text-align:right !important;">Re-enter password: </td>
<td width="227" >
<input style="width:180px" type="password" name="txtPassword2" id="txtPassword2" maxlength="17" onKeyUp="match(this.value,txtPassword.value) " >
</td>
</tr>
<tr id="rowPassword" style="display:none">
<td> </td>
<td><span id="password_match_status"><img 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;">First Name:</td>
<td><input style="width:180px" name="txtFirstName" maxlength="15" value="" type="text" onFocus="document.getElementById("rowPassword").st yle.display=''"></td>
</tr>
<tr>
<td style="text-align:right !important;">Last Name:</td>
<td><input type="text" name="txtContactNum" id="txtContactNum" value="" maxlength="100" style="width:180px" > </td>
</tr>
<tr>
<td style="text-align:right!important;width:130px">Contact Number:</td>
<td>
<input type="text" name="txtContactNum" id="txtContactNum" value="" maxlength="100" style="width:180px" > </td>
</tr>
<tr>
<td style="text-align:right!important;width:130px">Email Address:</td>
<td>
<input type="text" name="txtEmailAdd" id="txtEmailAdd" value="" maxlength="100" style="width:180px" > </td>
</tr>
<tr>
<td style="text-align:right !important;">Gender:</td>
<td valign="middle">
<input name="rdioGender" type="radio" value="Male" checked>Male
<input name="rdioGender" 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]