Verify if Yes/No radio button has changed

I am trying to process some code each time a yes/no field changes in my form.
However, I have tried two versions of getting the .change event to trigger but I don’t believe I am referencing my field correctly…

for my field I have tried.
$(’#view_788-field_259’).change(function(){

as well as
$(‘input:radio[name=“field_259”]’).change(function(){

Neither of these seems to work. I have included a very simple version of my full code below as well for reference.

$( document ).ready(function() {
$(document).on(‘knack-view-render.view_788’, function (event, view, data) {

$('#view_788-field_259').change(function(){ 

		alert("the field has changed")
});


  });

});

Hello Mike,

Just place the below code and check.

$("#view_788-field_259").live(“change”, function () {
alert(“the field has changed”);
});

no need to add other code like document.ready and knack view render.

Regards,
Sunny Singla
ssingla1985@gmail.com
+919855089359

Hi Sunny,

Thanks for this but it did not work… I removed all my other code and just put the line you gave me but I still do not get any alert.

Hello Mike,

Try below code

$(“input[name=view_788-field_259]”).live(“click”,function(){

alert(“the field has changed”);

});

before by mistake, I give code for dropdown.

Regards,
Sunny Singla