使用javascript选择单选按钮?

使用javascript选择单选按钮?,javascript,html,Javascript,Html,我需要帮助,因为我已经开发了单选按钮一个是支票,另一个是在线-转账当用户单击支票时,它会显示一个表单,如果用户单击在线转账,它会使用java脚本显示另一个表单确定它正在工作,但在刷新浏览器后单击一个单选按钮,则无法显示任何表单。下面是我的附件代码请验证并建议我。 html代码: <html> <head> <script text="text/javascript"> function optionChanged() { var a=document.wit

我需要帮助,因为我已经开发了单选按钮一个是支票,另一个是在线-转账当用户单击支票时,它会显示一个表单,如果用户单击在线转账,它会使用java脚本显示另一个表单确定它正在工作,但在刷新浏览器后单击一个单选按钮,则无法显示任何表单。下面是我的附件代码请验证并建议我。 html代码:

<html>

<head>
<script text="text/javascript">
function optionChanged()
{
var a=document.withdrawform;
if(a.withdraw_by[0].checked)
{

a.reset();a.withdraw_by[0].checked=true;
document.getElementById("cheque_msg").style.visibility="visible";
document.getElementById("cheque_msg").style.display="block";
document.getElementById("accountInfo").style.visibility="hidden";
document.getElementById("accountInfo").style.display="none";
}
else
{
a.reset();a.withdraw_by[1].checked=true;
document.getElementById("accountInfo").style.visibility="visible";
document.getElementById("accountInfo").style.display="block";
document.getElementById("cheque_msg").style.visibility="hidden";
document.getElementById("cheque_msg").style.display="none";
}
}
</script>
</head>
<body>
<!--<a target="popup" onclick="window.open('https://www.facebook.com/','name','width=600,height=400')">Open page in new window</a>-->

<div class="main_content">
    <p class="ca_head">Withdraw Cash</p>
        <ul class="step_bar"> 
            <li>1. Give your information</li> 
            <li class="active">2. Select Withdraw Option</li> 
        </ul>
        <form id="withdrawform" name="withdrawform" method="post" action="withdraw-confirmation.html" onsubmit="clearErrors();">        
            <input type="hidden" name="bankAccount" id="bankAccount" value="0"/>
            <input type="hidden" name="monthlyWithdraw" id="monthlyWithdraw" value="0"/>
            <input type="hidden" name="withdrawableBalance" id="withdrawableBalance" value="0.37"/>             
            <input type="hidden" id="ecsCharge" value="0"/>
            <input type="hidden" id="chequeCharge" value="0"/>
            <input type="hidden" id="freeWithdrawCount" value="0"/>
            <input type="hidden" id="withdrawError" value=""/>
            <input type="hidden" name="ifsc" id="ifsc" value="N"/>
            <div class="content_area">
            <h3 class="sub_head">Submit your withdraw request for processing</h3>
            <div class="form_row">
                <label>Your Withdrawable Balance <strong>:</strong></label>
                <strong><span class="rupeefont">r&nbsp;</span>&nbsp;0.37</strong>
            </div>
            <div class="form_row">
                <label for="new_mobile">Withdraw by <strong>:</strong></label>
                <div class="flt_lt wid_256" id="withdraw_options">
                    <label class="lbl_flt">
                        <input type="radio" name="withdraw_by" id="withdraw_by" onclick="optionChanged()" value="Cheque" /> Cheque                      
                    </label>
                    <label class="lbl_flt">
                        <input type="radio" name="withdraw_by" id="withdraw_by" onclick="optionChanged()" value="Online Transfer"/> Online Transfer
                    </label>
                </div>
            </div>  
            <div id="cheque_msg" style="display:none;visibility:hidden"><span><p style="color:RED" align="justify">Please Note that Withdrawal by cheque would take upto 12 working days. Online Transfer is a much faster
option.Also, cheque would be dispatched to your regsitered mailing address.Submit your withdrawal request only if the address below is valid.If you wish to
update your address,please write to fairplay@RummyNo1.com along with your address proof.
            </p>
            <div class="form_row">
                <label for="trackAmount">Enter the Amount <strong>:</strong></label>
                <input type="text" name="trackAmount" id="trackAmount" class="flt_lt" style="width:138px;" maxlength="15"/>
            </div>

            </div>


            <div id="accountInfo" style="display: none;">
                <div class="form_row" style="position:relative;">



                    <div class="form_row">
                        <label for="accountNumber">Account number <strong>:</strong></label>
                        <input type="text" maxlength="45" name="accountNumber" id="accountNumber" class="flt_lt" style="width:138px;"/>
                    </div>
                    <div class="form_row">
                        <label for="reAccountNumber">Re enter account number <strong>:</strong></label>
                        <input type="text" maxlength="45" name="reAccountNumber" id="reAccountNumber" class="flt_lt" style="width:138px;"/>                     
                    </div>
                    <div class="form_row">
                        <label for="micr">MICR Code <a href="javascript:openMicrPopup();" class="imagelink"><!-- <img src="https://rcmg.in/rc/icon_info.png"  border="0" />--></a>&nbsp;<strong> :</strong></label>
                        <input type="text" maxlength="9" name="micr" id="micr" class="flt_lt" style="width:138px;" />                               
                    </div>
                    <div class="form_row">
                        <label for="reMicr">Re enter MICR code <strong>:</strong></label>
                        <input type="text" maxlength="9" name="reMicr" id="reMicr" class="flt_lt" style="width:138px;"/>
                    </div>                  


            <div class="form_row">
                        <label for="ifsc_code">IFSC Code <a href="javascript:openIfscPopup();" class="imagelink"><!-- <img src="https://rcmg.in/rc/icon_info.png"  border="0" />--></a>&nbsp;<strong>:</strong></label>
                        <input type="text" maxlength="11" name="ifsc_code" id="ifsc_code" class="flt_lt" style="width:138px;" onkeypress="return onlyAlphaNumericsForIfsc(event)" />                        
                    </div>
                    <div class="form_row">
                        <label for="bank_name">Bank Name <strong>:</strong></label>
                        <input type="text" maxlength="30" name="bank_name" id="bank_name" class="flt_lt" style="width:138px;" onkeypress="return onlyAlphaNumerics(event)" />                       
                    </div>
                    <div class="form_row">
                        <label for="branch_name">Branch Name <strong>:</strong></label>
                        <input type="text" maxlength="30" name="branch_name" id="branch_name" class="flt_lt" style="width:138px;" onkeypress="return onlyAlphaNumerics(event)" />                       
                    </div>

            </div>

            <div class="form_row">
                <label for="trackAmount">Enter the Amount <strong>:</strong></label>
                <input type="text" name="trackAmount" id="trackAmount" class="flt_lt" style="width:138px;" maxlength="15"/>
            </div>
            <div class="form_row" id="withdrawButton">
                <label>&nbsp;</label>
                <input type="submit" name="submit_btn" title="Continue" value="Continue" class="btn_submit" id="withdrawsubmit"/>
            </div>  
            <p class="info_txt">
                For more information on service charges and withdrawing cash from your account, 
                <a href="javascript:openInfoPopup();" title="Information on Withdrawing Cash">click here</a>. 
            </p>
            <!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -->
        </div>
    </form>
</div>


</body>

</html>   

您的控制台怎么说?选择单选按钮刷新浏览器后,无法显示任何表单,但选择了单选按钮@Miss Chetan Gawai您在控制台中有任何错误吗?没有@Miss Chetan Gawai它正在工作,但我想在选择单选按钮刷新浏览器后,浏览器单选按钮处于选中状态,但单选按钮相关表单没有在Chetan Gawai小姐处展示