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

Question

Question

Adding checkbox to CSS class causes label alignment to go off

asked on April 3, 2020

What is causing this?  Even using padding for the label cannot get the label to move back to where it should be:

 how it looks with "checkbox" in CSS class, and

 how it looks when I remove "checkbox"

0 0

Answer

SELECTED ANSWER
replied on April 14, 2020

Hi Connie

Based on Xiuhong's info

The easiest thing to do would be to simply change your CSS Class name on your field from "checkbox' to 'chkbox' as an example. then change your code to use that class

//radio button choice triggers the Approve button to appear
$(document).ready(function() {
  $('.chkbox').click(function () {
     
    if($('input[value="Yes"]').is(':checked')) //edit the value here to use your own.
       {
       $('.Submit').show();
       }
    else {
      $('.Submit').hide();
    }
  });                 
});

0 0
replied on April 15, 2020

That worked!  Thank you, Xiuhong and Steve!!!

0 0

Replies

replied on April 14, 2020

There is built in CSS class for checkbox label as following which will add padding on the left.

.checkbox label, .radio label{

min-height: 20px;

padding-left: 20px;

 

margin-bottom: 0;

font-weight: 400;

cursor: pointer; *

}

 

When set custom CSS, please avoid use the built-in ones such as checkbox/number etc. 

1 0
replied on April 4, 2020

I assume you have an existing checkbox class defined in your CSS or JS that  would be impacting this

0 0
replied on April 5, 2020

//radio button choice triggers the Approve button to appear
$(document).ready(function() {
  $('.checkbox').click(function () {
     
    if($('input[value="Yes"]').is(':checked')) //edit the value here to use your own.
       {
       $('.Submit').show();
       }
    else {
      $('.Submit').hide();
    }
  });                 
});

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

Sign in to reply to this post.