# Verify if Yes/No radio button has changed

**URL:** <https://forums.knack.com/t/verify-if-yes-no-radio-button-has-changed/11953>\
**Category:** Get Answers\
**Created:** [January 28, 2022, 3:42am UTC](https://forums.knack.com/t/verify-if-yes-no-radio-button-has-changed/11953 "2022-01-28T03:42:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mikeacce](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Mikeacce](https://forums.knack.com/u/Mikeacce)\
**Post date:** [January 28, 2022, 3:42am UTC](https://forums.knack.com/t/verify-if-yes-no-radio-button-has-changed/11953/1 "2022-01-28T03:42:53Z")

</div>

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")
});

  });

```

});

---

<div class="post-metadata">

**Author:** ![Sunny\_Singla](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/sunny_singla/32/1007_2.png) [@Sunny\_Singla](https://forums.knack.com/u/Sunny_Singla)\
**Post date:** [January 28, 2022, 4:13am UTC](https://forums.knack.com/t/verify-if-yes-no-radio-button-has-changed/11953/2 "2022-01-28T04:13:11Z")

</div>

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](mailto:ssingla1985@gmail.com)  
+919855089359

---

<div class="post-metadata">

**Author:** ![Mikeacce](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Mikeacce](https://forums.knack.com/u/Mikeacce)\
**Post date:** [January 28, 2022, 4:46pm UTC](https://forums.knack.com/t/verify-if-yes-no-radio-button-has-changed/11953/3 "2022-01-28T16:46:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Sunny\_Singla](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/sunny_singla/32/1007_2.png) [@Sunny\_Singla](https://forums.knack.com/u/Sunny_Singla)\
**Post date:** [January 31, 2022, 3:02pm UTC](https://forums.knack.com/t/verify-if-yes-no-radio-button-has-changed/11953/4 "2022-01-31T15:02:42Z")

</div>

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
