koder
July 1, 2016, 2:30pm
1
I have a radio button, while clicking on it its slides a form, again if I clicked on that no action shouldn’t be taken place because radio buttons are not toggle case. how can I do this.
Html:
<div >
<input type="radio" id="shippingform" name="shippingform">
<label for="shippingform">SHIPPING HOME</label>
<span id="shipping_radio_chk" class="check"></span>
</div>
JS:
$("#ShippingAddress_Form").hide();
$("#shippingform").on('click', function(){
$("#ShippingAddress_Form").show();
$("this").attr("disabled","disabled");
delete the radio button if it was clicked. in which case you could also use a button.
koder
July 1, 2016, 2:35pm
3
@Dormilich : Th radio button should be shown with checked while selecting.
koder
July 1, 2016, 2:46pm
5
If I selected radio button it should show a div after that radio button should not be clickable.
if the radio button has no further use, you can delete it.
It’s $(this)
, not $("this")
.
Entirely removing an element from the DOM only because you currently don’t need it seems a bit over the top to me TBH. ^^
Are you just wanting to prevent your on click event from happening a second time?
You can turn off that click event which will stop it from happening again.
$("#shippingform").on('click', function(){
$("#ShippingAddress_Form").show();
$("#shippingform").off('click');
});
koder
July 4, 2016, 4:59pm
9
@Paul_Wilkins : Thank you, It’s working…
system
Closed
October 3, 2016, 11:59pm
10
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.