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

Question

Question

hide submit and field

asked on September 30, 2015

Good Morning,

I am trying to do 2 things.   I have a form that is to be filled out only once.   If someone tries to fill it out again I want to hide the submit button based on a field (in this case q32) that is filled in by a lookup rule.    This field is null if they haven't filled in the form before.  If they have it will have a date.   I've tried various examples based on other Answer questions, but I can't get them to work correctly.  Also this field q32 needs to be hidden when the user fills in this form the 1st time it should only be shown IF the form has been filled in before.    This is what I've tried.   Note:   I am a novice at JavaScript so ANY help would be gratefully appreciated.  Thanks!

 

$(document).ready(function(){

  $('.Submit').hide();
    
    $('#q32 imput').on('blur', function(){
    if($('#q32 imput').val() =="") {
      $('.Submit').show();
    }else {
      $('.Submit').hide();
    }
  });
  
});

$(document).ready(function(){

  $('#q32').hide();
    
    $('#q32 imput').on('blur', function(){
    if($('#q32 imput').val() =="") {
      $('#q32').hide();
    }else {
      $('#q32').show();
    }
  });
  
});

0 0

Answer

SELECTED ANSWER
replied on September 30, 2015

Hi Rebecca,

I don't know if its just a typo but you've spelled "input" wrong in your code! Also if you want the script to run immediately when the document loads you'll have to get rid of the on blur function as this will only start this section of the script when the user tabs out of the field q32.

Hope this helps!

Dan

0 0

Replies

replied on September 30, 2015

Thanks, that was a typo.  blush  I changed the code from blur to change and it does seem to be working now.

thanks!

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

Sign in to reply to this post.