I am trying to switch a DIV database to a selection of radio buttons.
HTML for the switch.
<div class="row-fluid">
<label class="radio">
<input type="radio" name="account" id="yes" value="yes" checked>
Yes, I have an existing account
</label>
<label class="radio">
<input type="radio" name="account" id="no" value="no">
No, I don't have an account
</label>
</div>
DIV Content
<div id="account_contents">
<p>This is account contents.......</p>
</div>
This is how I tried this in jquery.
$('#no').bind('change',function(){
$('#account_contents').fadeToggle(!$(this).is(':checked'));
$('#account_contents').find("input").val("");
$('#account_contents').find('select option:first').prop('selected',true);
});
But this does not work for me correctly. Here I want to show this DIV content only if the user does not have an account.
Can someone tell me how to solve this problem?
source
share