adsense

Thursday, January 24, 2019

get RadioButtonList selected value.

You can use jQuery / JavaScript to get the selected value of a RadioButtonList . jQuery provides much more simpler approach as shown below.

jQuery
var selectedVal = $('#<%= RadioButtonList.ClientID %> input:checked').val();

JavaScript

var radioList= document.getElementById("<%= RadioButtonList.ClientID %>");
 var options= radioList.getElementsByTagName("input");
 var selected;
 for (var i = 0; i < options.length; i++) {
      if (options[i].checked) {
          selected = options[i];
          break;
       }
  }
  if (selected) {
       alert(selected.value);
  }

Regards,
Samitha

Wednesday, January 9, 2019

jQuery find element in a table

jQuery can be used to find an element inside a table easily as shown below.

var td = $("#tbIntervalos").find("#tdId");

cheers
Samitha