How to Compare a radio Selection in JSP. I want to make radio selection unselectable depending on the another radio selection.
Below is Jsp Code. The JSP Page is linked with some Java files where the retrieve and display is done from the database.
Below is the link which contains the image for better understanding of the issue.
<html>
<script>
function chk()
{
var txt=document.getElementById("amount");
txt.value= parseFloat(txt.value).toFixed(2);
alert (i.value);
}
</script>
<center>
<table border=0 cellpadding=2 cellspacing=0 width=500 summary="layout">
<tr>
<td valign="top" colspan="4">
<c:url var="url" value="/transferAck" />
<form name="transfer" method="post" action="${url}" >
<table border=1 cellpadding=2 cellspacing=0 summary="layout">
<tr>
<td><b><fmt:message key="AccountName"/></b></td>
<td><b><fmt:message key="AccountId"/></b></td>
<td><b><fmt:message key="AccountBalance"/></b></td>
<td><b><fmt:message key="AccountFrom"/></b></td>
<td><b><fmt:message key="AccountTo"/></b></td>
</tr>
<c:forEach items="${accounts}" var="ad">
<tr>
<td>${ad.description}</td>
<td>${ad.accountId}</td>
<td align="right"><fmt:formatNumber value="${ad.balance}" type="currency" /></td>
<td><input type="radio" name="fromAccountId" value="${ad.accountId}"></td>
<td><input type="radio" name="toAccountId" value="${ad.accountId}"></td>
</tr>
</c:forEach>
</table>
</td>
</tr>
</script>
<tr>
<td><b><fmt:message key="TransferAmount"/></b></td>
<td><input id="amount" type="text" size="15" name="transferAmount" onblur="chk()"></td>
<td><input type="submit" value="<fmt:message key='Submit'/>"></td>
<td><input type="reset" value="<fmt:message key='Clear'/>"></td>
</form>
</tr>
</table>
</center>
</html>