html:
<div id="member_form" style="display:none">
<form id="contactform" method="post" action="." onsubmit="if($('input[name=name]').is(':checked')){return true;}else{$('#choose_warning').show();return false}">
{% csrf_token %}
<h2> Choose Person</h2>
<br />
{% if contact_list %}
{%for contact in contact_list%}
<input type="radio" name="name" id="contact" value="{{contact.first_name}} {{contact.last_name}}" maxlength="30" />
{{contact.first_name|title}} {{contact.last_name}}<br />
{% endfor %}
<input type="hidden" name="action_type" value="" id="member_action_type" maxlength="30" />
<p style="display:none;color:red" id="choose_warning">Please choose a contact.</p>
<div style="width:180px;margin:20px 5px 0 10px" align="left">
<button style="margin-right:10px;" type="button" class="close" name="cancel" class="forward backicon">
<img src="{{ STATIC_URL }}images/button-icon-ir-back.png" width="12" height="17" alt="" />
Cancel</button> {% include "buttons/add.html" %}
</div></form>
js:
$(document).ready(function(){
$(".add_list").click(function(){
'''''''
$("#member_form").fadeIn(1000);
});
$(".close").click(function(){
$("#member_form").fadeOut(500);
});
});
我的问题是如果我选择一个单选按钮并按取消,如果我打开弹出窗口而不刷新,所选单选按钮处于选中模式,我希望它清除,如果我单击取消按钮并打开弹出窗口,怎么办在这里。