Using Gravity Forms, can I use gform_input_change to create a function to change the state of checkboxes?

[ad_1]

I am trying to recreate this basic form (see below) using Gravity Forms. From what I can tell, gform\_input\_change is probably how I would accomplish this, but I’m not really sure how to rewrite the function to provide the desired results. If not gform\_input\_change, how would I accomplish this?

The purpose is to create a conditional which is based on all the check boxes being empty. The form will have many more fields, but I want to display another form element based on fm1\_check, fm2\_check, and fm3\_check all being checked or unchecked.

<DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”utf-8″>
<title>Test Form</title>
</head>

<body>
<form>

<input type=”text” name=”fm1″ id=”fm1″ onchange=”uncheck(‘fm1’, ‘fm1_check’)” />
<input type=”checkbox” name=”fm1_check” id=”fm1_check” value=”yes” checked />
<br /><br />
<input type=”text” name=”fm2″ id=”fm2″ onchange=”uncheck(‘fm2’, ‘fm2_check’)” />
<input type=”checkbox” name=”fm2_check” id=”fm2_check” value=”yes” checked />
<br /><br />
<input type=”text” name=”fm3″ id=”fm3″ onchange=”uncheck(‘fm3’, ‘fm3_check’)” />
<input type=”checkbox” name=”fm3_check” id=”fm3_check” value=”yes” checked />

</form>

<script>
function uncheck(txtboxid, chkboxid){
if(document.getElementById(txtboxid).value != “”){
document.getElementById(chkboxid).checked = false;
} // end if
} // end function
</script>

</body>
</html>

[ad_2]
1 Comment
  1. You should be able to do that with GF’s built-in conditional logic feature [https://docs.gravityforms.com/enable-conditional-logic/])

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer