Hello I'm unfamiliar with JS and I need to find a way to disable a form I've created once a condition is met. Essentially, I will pull data from a database and bases on that data the page will be editable or read only. I know how the pull the information, but don't know how to disable the page using
Java Script. Here is my code:
javascript:%20x()
<html:form action="/SpecifyProjectRank.do">
<input type="hidden" name="allAppByUser" value="<bean:write name="sessionUser" property="username"/>" />
<html:hidden property="projectCode"/>
<html:hidden property="allocationID"/>
<table width="100%" height="100%">
<tr>
<td id="projectHeader" height="20%">
<h1 style="font-size:9pt;font-weight:bold;height:20px;margin:0;padding:0">Allocation</h1>
<table width="100%" class="main">
<tr>
<tr>
<td align="left"><b>Fiscal Year:</b><br>
<html:text property="years" style="border:none;"disabled="false"/></td>
<td align="left"><b>Service:</b><br>
<html:text property="serviceName" style="border:none;"disabled="false"/></td>
<td align="left"><b>Base:</b><br>
<html:text property="baseName" style="border:none;"disabled="false"/></td>
<td align="left"><b>State:</b><br>
<html:text property="stateCode" style="border:none;"disabled="false"/></td>
<td align="left" width="20%"><a href="#">View Proposal PDF</a></td>
</tr>
<tr>
<td align="left"><b>Primary Justification:</b>
<html:text property="justDesc" style="border:none;" disabled="false"/></td>
<td align="left"><b>Serivce Rank:</b>
<html:text property="serviceProjectRank" style="border:none;" disabled="false"/></td>
<td align="left"><b>Project Status:</b>
<html:text property="statusDesc" style="border:none;" disabled="false"/></td>
<td> </td>
<td align="left"><a href="EditProject.do?projectCode=<%=((HttpServletRequest)req).getParameter("projectCode")%>"/>Edit Details</a></td>
</tr>
<tr>
<td align="left"><b>Created On:</b>
<html:text property="dateCreated" style="border:none;"disabled="false" /></td>
<td align="left"><b>Created By:</b>
<html:text property="createdByUser" style="border:none;" disabled="false"/></td>
<td align="left"><b>Updated On:</b>
<html:text property="dateLastUpdated" style="border:none;" disabled="false"/></td>
<td align="left"><b>Updated By:</b>
<html:text property="updatedByUser" style="border:none;" disabled="false"/></td>
</tr>
<tr>
<td align="left"><b>Headquarters POC Name:</b><br>
<html:text property="hQPocName" style="border:none;" disabled="false"/></td>
<td valign="top" align="left"><b>Headquarters POC Phone:</b><br>
<html:text property="hQPocPhone" style="border:none;" disabled="false"/></td>
<td valign="top" align="left"colspan="2"><b>Headquarters POC Email:</b><br>
<html:text property="hQPocEmail" style="border:none;" disabled="false"/></td>
</tr>
<tr>
<td align="left">
<b>Total Proposed Project Funds:</b><br>
<html:text property="proposedTotal" style="border:none;" disabled="false"/>
<td align="left">
<b>Total Project Funds Expended to Date:</b><br>
<html:text property="expToDate" style="border:none;" disabled="false"/>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td id="projectTabs" height="%" valign="top" align="left">
<table class="main">
<tr>
<td style="border:solid grey 1px;background-color:lightgrey"><a href="ProjectDetailProposalService.do?projectCode=<%=((HttpServletRequest)req).getParameter("projectCode")%>"/>Proposal</a></td>
<td style="border:solid grey 1px">Allocation</td>
<td style="border:solid grey 1px;background-color:lightgrey"><a href="ProjectDetailObligation.do?projectCode=<%=((HttpServletRequest)req).getParameter("projectCode")%>"/>Obligation</a></td>
<td style="border:solid grey 1px;background-color:lightgrey"><a href="ProjectDetailExpenditure.do?projectCode=<%=((HttpServletRequest)req).getParameter("projectCode")%>"/>Expenditure</a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" class="main" >
<tr>
<td valign="top" align="left"><b>Initial OSD Rank:</b><br>
<html:text property="initialOsdRank" styleClass="required" disabled="false"/>
</td>
<td valign="top" align="left"><b>Initial Allocation:</b><br>
<html:text property="initialAllAmount" disabled="false"/>
</td>
</tr>
<tr>
<td valign="top" align="left"><b>Revised OSD Rank:</b><br>
<html:text property="revisedOsdRank"disabled="false"/>
</td>
<td valign="top" align="left"><b>Revised Allocation:</b><br>
<html:text property="revisedAllAmount"disabled="false"/>
</td>
</tr>
<tr>
<td valign="top" align="left"><b>Final OSD Rank:</b><br>
<html:text property="finalOsdRank" styleClass="required" disabled="false"/>
</td>
<td valign="top" align="left"><b>Final Allocation:</b><br>
<html:text property="finalAllAmount" styleClass="required" disabled="false"/>
</td>
</tr>
<tr>
<td valign="top" align="left" colspan="2"><b> Notes:</b><br>
<html:textarea property="allNotes" style="width:50%;"disabled="false">
</html:textarea>
</td>
</tr>
</td>
</tr>
</table>
</table>
</html:form>
javascript:%20x()