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

Question

Question

Based on a radio answer, user cannot submit

asked on November 9, 2017

I would like to disable to Submit button based on the answer given in a radio button. Is this possible? I have a warning message show if they answer yes to the question, i just want them to not be able to submit as well.

0 0

Answer

SELECTED ANSWER
replied on November 9, 2017 Show version history

Something like this:

 

$( document ).ready(function() {
$('.Submit').attr('disabled', true);

  $(document).on('click', '.Question input', checkQuestion);
  
  function checkQuestion() {
  
  var Question = $('.Question input:checked').val();
  
    if (Question == 'No') {
      
      $('.Submit').attr('disabled', true);
      
    }
    else
    {
  
      $('.Submit').removeAttr('disabled');
    }
  
}

});

 

q1.PNG
q2.PNG
q1.PNG (10.26 KB)
q2.PNG (10.38 KB)
0 0

Replies

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

Sign in to reply to this post.