You are viewing limited content. For full access, please sign in.

Question

Question

Clear a form if a field is populated

asked on May 29, 2015 Show version history

Hi,

Scenario,

If a Field is (Called Duplicate)populated, all fields on the form are hidden. 

I have tried this with the Rules engine but all sub questions that were previously hidden now show when the field (Duplicate)is not populated

Has anyone done anything similar to this 

Thanks in advance

I would be looking for a Clear form or Display none if the Field is (Called Duplicate)populated

0 0

Replies

replied on May 29, 2015 Show version history

You would need to use javascript for this.

Something like this:

$(document).ready(function () {
    $('#q102').on('blur','input', firstfield);
    function firstfield() {
    	if($('#q102 input').val() != "")
          $('#q106').val() = '';

$(document).ready(function () { <----- standard starting javacode

    $('#q102').on('blur','input', firstfield); <----- If info in field #q102 has been changed.

    function firstfield() { <----- start of function

     if($('#q102 input').val() != "") <------ If field #q102 is not empty

          $('#q106').val() = ''; <------ set field #q106 to blank

if you have more fields that needs to be cleared, you can add an additional   $('#q106').val() = ''; and change the #qxxx value. 

i.e.

$(document).ready(function () {
    $('#q102').on('blur','input', firstfield);
    function firstfield() {
    	if($('#q102 input').val() != "")
          $('#q106').val() = '';
          $('#q107').val() = '';
          $('#q108').val() = '';

 

0 0
replied on May 29, 2015

Sorted By Creating sections and Creating rules on sections

 

0 0
replied on May 29, 2015

So I created Sections and used the Rule to hide the section based off the field Being populated

Thank you for Your assistance

 

I will need to Hide the Submit button and I believe that would be JavaScript

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.