I have a code here .
<div class="proptions_container">
<button class="showbutton classname" >Call</button>
<div id="rd" style="display:none;">
<form id="blankform">
<input class="check_val" type="radio" name="check_val" onClick="setShemp(this.value)" value="callondesktop">Call On Desktop<br>
</form>
<form id="valueform">
<input class="check_val" type="radio" name="check_val" onClick="setShemp(this.value)" value="callonphone">Call On Phone
</form>
</div>
<div id="custom_proptions" style="display:none;">
<form style="border: 1px solid; display: block; float: left; padding: 13px 13px 12px 14px;">
<input name="proption_1" type="text" class="text" id="proption_1" placeholder="First Proption" />
<br>
<input name="proption_2" type="text" class="text" id="proption_2" placeholder="Second Proption" />
<br>
<input type="submit" class="classname" value="Call" />
<button id ="cancel" class="classname">Cancel</button>
</form>
</div>
<script>
function setShemp(value)
{
if(value == 'callondesktop')
{
$("#blankform").submit();
}
if(value == 'callonphone'){
$('div#rd').slideUp('slow');
$('.showbutton').hide();
$('#custom_proptions').slideDown('slow');
}
}
$('#cancel').click(function(e) {
$('.check_val').val('');
e.preventDefault();
$('#custom_proptions').slideUp('slow');
e.preventDefault();
//$('div#rd').slideDown('slow');
$('.showbutton').show();
});
$('.showbutton').click(function() {
$('div#rd').slideDown('slow');
});
$('#proptions').click(function() {
if ($(this).find(':selected').val() === '5') {
$('div#custom_proptions').slideDown('slow');
} else {
$('div#custom_proptions').slideUp('slow');
}
});
</script>
There is two radio button is appearing while clicking on call button (None of them are checked ).
After selecting the the Call on Phone
radio i am displaying a html form which contains two button Call
and Cancel
.
On clicking over Cancel
i am just displaying the main call
button .
Now here is the problem . While clikcing to Main Call
button the previous selected value of the radio is appearing which i don't want .
I want none of the radio value should be selected while clicking on call button.
Kindly do let me know why radio button value is diplaying as a selected value for the second time .What might i am doing wrong here ?