Skip to content

Instantly share code, notes, and snippets.

@A2H111
Created July 12, 2017 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save A2H111/fc7e3f56315999b6e5beda5ff71f1fd0 to your computer and use it in GitHub Desktop.
Save A2H111/fc7e3f56315999b6e5beda5ff71f1fd0 to your computer and use it in GitHub Desktop.
<script src="https://code.jquery.com/jquery-3.0.0.js"></script>
<script type="text/javascript">
$(document).ready(function () {
//Attach change event to radiobuttonlist controls
$("input:radio").change(function (obj) {
//Get the selected radiobutton value
var type = $.trim($(this).val());
//check if value selected is equal to Yes
if (type == "Yes") {
//find the textbox control based on selected radiobutton control
//Use the props to enable and disable the textbox control
$(this).closest(".container").find(".txtbox").prop("disabled", false);
}
else
$(this).closest(".container").find(".txtbox").prop("disabled", true);
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment