
This is my code part:-
<table cellpadding="0" cellspacing="0" align="center" border="5" bordercolor="#003333" align="center" width="70%">
<tr>
<td width="25%">
<b class="label">Payment Type<b>
</td>
<td width="40%">
<INPUT TYPE=radio NAME="payment_method" VALUE="cash" CHECKED><b class="label">By Cash</b></input>
<INPUT TYPE=radio NAME="payment_method" VALUE="cheque" onclick="return payment();"><b class="label">By Cheque</b></input>
</td>
<td>
<b class="label">Payment Date<b>
</td>
<td>
<jsp:include page="calendar_1.html" />
</td>
</tr>
<tr rowspan="4">
<td>
<b class="label">Cheque Number<b>
</td>
<td>
<input type="text" value="" name="chqno">
</td>
<td>
<b class="label">Bank Name<b>
</td>
<td>
<input type="text" value="" name="bankname">
</td>
</tr>
<tr colspan="2">
<td>
<b class="label">Amount<b>
</td>
<td>
<input type="text" value="" name="amount1">
</td>
</tr>
</table>
I want bank name and cheque number label and textbox to be invisible when by cash radio button is clicked.and they should be visible when by cheque radio button is clicked.
I have applied javascript for this as:-
function payment(e) { if (e.value==cash) { document.getElementById(chqno).style.display=block; document.getElementById(bankname).style.display=block; } else { document.getElementById(chqno).style.display=none; document.getElementById(bankname).style.display=none; }
}
please help me with this
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.