Tuesday 27 July 2010

JQuery Radio Button and inner HTML .

JQuery to check radio button for value and set inner html value.


$("input[@name='property_type']").change(function() {
 if ($("input[@name='property_type']:checked").val() == 'aroom') {
  // Code for handling value 'aroom'
  value = 'Radio Button as follows';
  value = value + '< input type="radio" name="property_shared" id="property_shared" value="yes" checked="checked" />Yes   < input type="radio" name="property_shared" id="property_shared" value="no" />No';
  $("#shared_property_option").html(value);
 }
 else { // Code for handling value for else case.
  $("#shared_property_option").html('');
 }
});

No comments:

Post a Comment

Please post any queries and comments here.