I have been trying to get this form to work but it just dont seem to work. The buttons does nothing but keeps pointing to the same form. This is for the mozilla browser. Did I miss something?
<html>
<head>
<title>Admin</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../_assets/skin/cms.css" rel="stylesheet" type="text/css" />
</head>
<SCRIPT language="JavaScript">
function OnSubmitForm()
{
if(document.pressed == 'add')
{
document.searchTreatment.action ="/addTreatment.jsp"
}
else if(document.pressed == 'search')
{
document.searchTreatment.action ="/listTreatment.jsp"
}
return true;
}
}
</SCRIPT>
<body>
<jsp:include page="../_includes/header.jsp" />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="345">
<table width="300" height="540" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="163"><img src="../_assets/images/client_images/admin.jpg" width="225" height="225" /></td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="935" colspan="1" valign="top"><br />
<table border="0" cellspacing="0" cellpadding="0" width="682">
<tr>
<td width="682" class="pageName">Admin</td>
</tr>
<tr>
<td class="bodyText">
<form method="GET" name="searchTreatment" id="searchTreatment" onSubmit="return OnSubmitForm();">
<table width="395" height="142" border="0">
<tr>
<td height="20" class="tableHeader">
<div align="left">Search Treatment</div></td>
</tr>
<tr>
<td width="388" height="72">
<table width="374" border="0">
<tr>
<td width="192">Treatment Id</td>
<td width="293"><label>
<input type="text" name="masterTreatmentId" id="masterTreatmentId" class="textField" />
</label></td>
</tr>
<tr>
<td>Treatment Name</td>
<td><label>
<input type="text" name="treatmentName" id="treatmentName" class="textField" />
</label></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center"><label>
<input type="submit" name="searchTreatment" id="searchTreatment" value="Search Treatment" onClick="document.pressed='search'" />
<input type="reset" name="Reset" value="Reset" />
<input type="submit" name="addTreatment" id="addTreatment" value="Add Treatment" onClick="document.pressed='add'" />
</label></td>
</tr>
</table>
</form>