# How to verify if a yes/no field has changed

**URL:** <https://forums.knack.com/t/how-to-verify-if-a-yes-no-field-has-changed/11810>\
**Category:** Get Answers\
**Created:** [December 31, 2021, 7:51pm UTC](https://forums.knack.com/t/how-to-verify-if-a-yes-no-field-has-changed/11810 "2021-12-31T19:51:42Z")\
**Posts on this page:** 3\
**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:** [December 31, 2021, 7:51pm UTC](https://forums.knack.com/t/how-to-verify-if-a-yes-no-field-has-changed/11810/1 "2021-12-31T19:51:42Z")

</div>

Ok… this may be a very silly question and truth is, even I thought it was easy at first but I can’t seem to figure out how to get the change event to trigger when working with the yes/no fields.

I want to be able to unhide a field when a user chooses yes on a form and hide it when a user chooses no on the form. However, this form is not a form I created it is the default form the system creates when you click on the “add a new option” link in a form. It seems to generate its own form based on the scheme of that field.

Is there a special function for the yes/no fields… Is this done some other way other then the API that i have overlooked?

this is some of the coding options I have tried but nothing worked.  
var radioButton=$(‘select#view\_142-field\_6’)  
radioButton.change(function(){  
console.log $(this).val();  
if ($(this).val()) {  
//do someting  
}

//attempt #2  
var radioButton=$(view\_142-field\_6’)  
radioButton.change(function(){  
console.log $(this).val();  
if ($(this).val()) {  
//do someting  
}

Attempt #3  
var radioButton=$(view\_142-field\_6’)  
$(view\_142-field\_6’).change (function() {  
if (radioButton.) {  
console.log $(this).val();  
if ($(this).val()) {  
//do someting  
}  
});

I have checked through the API manual as well and they don’t talk about yes/no or even radio buttons (well at least not that I found).

any help would be appreciated.

---

<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 1, 2022, 4:51am UTC](https://forums.knack.com/t/how-to-verify-if-a-yes-no-field-has-changed/11810/2 "2022-01-01T04:51:28Z")

</div>

Hello Mike,

You can easily do this by knack display Rule. we also do this by javascript but not required here.

you can check here by clicking add new option.

[https://roberts.knack.com/farmers#add-item/](https://roberts.knack.com/farmers#add-item/)

on form you can click on arraw pointed to right  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/knack/original/2X/9/942e01860d8a19297c8e566603ed21881a65ed7a.png)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/knack/original/2X/2/25fe94a721834d431b3c78902e35d78239cfa56b.png)

Then the form is open, you can click then rule -\>form rules  
then add

 ![image](https://us1.discourse-cdn.com/flex020/uploads/knack/original/2X/1/1d9dfdfd2e617c4cddbdc0051658abe50cb6f088.png)

Regards,  
Sunny Singla  
[ssingla1985@gmail.com](mailto:ssingla1985@gmail.com)  
+919855089359

> **[Database consultant – Software database consultant](http://sandt-consultancyservices.com)**
>
> Just another WordPress site

---

<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 1, 2022, 1:12pm UTC](https://forums.knack.com/t/how-to-verify-if-a-yes-no-field-has-changed/11810/3 "2022-01-01T13:12:38Z")

</div>

> [@Sunny\_Singla](#):
>
> you can click then rule -\>form rules

Thank you… that worked… Much appreciated.
