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

Question

Question

How do i show\hide the Reject button based on a choice in a dropdown that is not in a table?

asked on August 5, 2015 Show version history

I need to hide the Reject button then show it if a dropdown field contains a value, or is not blank.

 

For reference i have attached what i have been trying to use and alter to no avail. 

$(document).ready(function() {
$('.Reject').hide();
  $('.Target').on('change', function();
if ($('.Target input').val()! == '') {
      $('.Reject').show();
    } else {
      $('.Reject').hide();
    }
});

 

0 0

Answer

SELECTED ANSWER
replied on August 5, 2015

There are some syntax errors in your Javascript. Try

$(document).ready(function() {
  $('.Reject').hide();
  $('.Target select').on('change', function() {
    if ($('.Target select').val() != '') {
      $('.Reject').show();
    } else {
      $('.Reject').hide();
    }
  });
});
1 0

Replies

replied on August 5, 2015

Thank you very much! I am still learning JavaScript and appreciate all the help I have received on the Answers website. 

0 0
replied on August 5, 2015

You're welcome. That's what we're here for.

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

Sign in to reply to this post.