Showed Checked Radio Button - Ninja Forms












0















I've made my radio buttons to full width, which wrap around the text, making entire text a radio button.



This is the code I used to make radio buttons look like buttons:



.list-checkbox-wrap .nf-field-element li label, .list-radio-wrap .nf- 
field-element li label {
margin-left:0em;}

label.radio {
cursor: pointer;
}

label.radio input {
position: absolute;
top: 0;
left: 0;
visibility: hidden;
pointer-events: none;
}


.list-checkbox-wrap .nf-field-element li label, .list-radio-wrap .nf-
field-element li label {
padding: 7px 14px;
border: 2px solid #EEE;
display: inline-block;
color: #009BA2;
border-radius: 3px;
text-transform: uppercase;
text-align:center;
}

input[type=checkbox], input[type=radio] {
visibility: hidden;
margin: 0;
width: 0!important;
}

input[type=checkbox] + label, input[type=radio] + label {
font-size: 16px;
}

input[type=checkbox] + label:hover, input[type=radio] + label:hover {
cursor: pointer; }

input[type=checkbox] + label:before, input[type=radio] + label:before{
font-family: "ETmodules";
font-size: 36px;
position: relative;
top: 0.3em;
margin-right: 0.2em;
}


However, I cannot manage to change border-color of box when radio button is selected.



html for radio buttons



<div class="nf-field-element"><ul aria-describedby="nf-error-37">

<li>
<input type="radio" id="nf-field-37-0" name="nf-field-37" class="ninja-forms-field nf-element nf-checked" value="Physical Product" aria-labelledby="nf-label-class-field-37-0">
<label for="nf-field-37-0" id="nf-label-class-field-37-0" class="nf-checked-label">Physical Product</label>
</li>
<li>
<input type="radio" id="nf-field-37-1" name="nf-field-37" class="ninja-forms-field nf-element" value="Digital Product" aria-labelledby="nf-label-class-field-37-1">
<label for="nf-field-37-1" id="nf-label-class-field-37-1" class="">Digital Product</label>
</li>
<li>
<input type="radio" id="nf-field-37-2" name="nf-field-37" class="ninja-forms-field nf-element" value="Subscription" aria-labelledby="nf-label-class-field-37-2">
<label for="nf-field-37-2" id="nf-label-class-field-37-2" class="">Subscription</label>
</li>
<li>
<input type="radio" id="nf-field-37-3" name="nf-field-37" class="ninja-forms-field nf-element" value="Service" aria-labelledby="nf-label-class-field-37-3">
<label for="nf-field-37-3" id="nf-label-class-field-37-3" class="">Service</label>
</li>
</ul></div>


this class is added to input when clicked



nf-checked


and this class is added to label when clicked



nf-checked-label









share|improve this question

























  • Can you please provide relevant HTML code as you are using other classes too (seems like outer elements)

    – iamshahid
    Nov 19 '18 at 0:16
















0















I've made my radio buttons to full width, which wrap around the text, making entire text a radio button.



This is the code I used to make radio buttons look like buttons:



.list-checkbox-wrap .nf-field-element li label, .list-radio-wrap .nf- 
field-element li label {
margin-left:0em;}

label.radio {
cursor: pointer;
}

label.radio input {
position: absolute;
top: 0;
left: 0;
visibility: hidden;
pointer-events: none;
}


.list-checkbox-wrap .nf-field-element li label, .list-radio-wrap .nf-
field-element li label {
padding: 7px 14px;
border: 2px solid #EEE;
display: inline-block;
color: #009BA2;
border-radius: 3px;
text-transform: uppercase;
text-align:center;
}

input[type=checkbox], input[type=radio] {
visibility: hidden;
margin: 0;
width: 0!important;
}

input[type=checkbox] + label, input[type=radio] + label {
font-size: 16px;
}

input[type=checkbox] + label:hover, input[type=radio] + label:hover {
cursor: pointer; }

input[type=checkbox] + label:before, input[type=radio] + label:before{
font-family: "ETmodules";
font-size: 36px;
position: relative;
top: 0.3em;
margin-right: 0.2em;
}


However, I cannot manage to change border-color of box when radio button is selected.



html for radio buttons



<div class="nf-field-element"><ul aria-describedby="nf-error-37">

<li>
<input type="radio" id="nf-field-37-0" name="nf-field-37" class="ninja-forms-field nf-element nf-checked" value="Physical Product" aria-labelledby="nf-label-class-field-37-0">
<label for="nf-field-37-0" id="nf-label-class-field-37-0" class="nf-checked-label">Physical Product</label>
</li>
<li>
<input type="radio" id="nf-field-37-1" name="nf-field-37" class="ninja-forms-field nf-element" value="Digital Product" aria-labelledby="nf-label-class-field-37-1">
<label for="nf-field-37-1" id="nf-label-class-field-37-1" class="">Digital Product</label>
</li>
<li>
<input type="radio" id="nf-field-37-2" name="nf-field-37" class="ninja-forms-field nf-element" value="Subscription" aria-labelledby="nf-label-class-field-37-2">
<label for="nf-field-37-2" id="nf-label-class-field-37-2" class="">Subscription</label>
</li>
<li>
<input type="radio" id="nf-field-37-3" name="nf-field-37" class="ninja-forms-field nf-element" value="Service" aria-labelledby="nf-label-class-field-37-3">
<label for="nf-field-37-3" id="nf-label-class-field-37-3" class="">Service</label>
</li>
</ul></div>


this class is added to input when clicked



nf-checked


and this class is added to label when clicked



nf-checked-label









share|improve this question

























  • Can you please provide relevant HTML code as you are using other classes too (seems like outer elements)

    – iamshahid
    Nov 19 '18 at 0:16














0












0








0








I've made my radio buttons to full width, which wrap around the text, making entire text a radio button.



This is the code I used to make radio buttons look like buttons:



.list-checkbox-wrap .nf-field-element li label, .list-radio-wrap .nf- 
field-element li label {
margin-left:0em;}

label.radio {
cursor: pointer;
}

label.radio input {
position: absolute;
top: 0;
left: 0;
visibility: hidden;
pointer-events: none;
}


.list-checkbox-wrap .nf-field-element li label, .list-radio-wrap .nf-
field-element li label {
padding: 7px 14px;
border: 2px solid #EEE;
display: inline-block;
color: #009BA2;
border-radius: 3px;
text-transform: uppercase;
text-align:center;
}

input[type=checkbox], input[type=radio] {
visibility: hidden;
margin: 0;
width: 0!important;
}

input[type=checkbox] + label, input[type=radio] + label {
font-size: 16px;
}

input[type=checkbox] + label:hover, input[type=radio] + label:hover {
cursor: pointer; }

input[type=checkbox] + label:before, input[type=radio] + label:before{
font-family: "ETmodules";
font-size: 36px;
position: relative;
top: 0.3em;
margin-right: 0.2em;
}


However, I cannot manage to change border-color of box when radio button is selected.



html for radio buttons



<div class="nf-field-element"><ul aria-describedby="nf-error-37">

<li>
<input type="radio" id="nf-field-37-0" name="nf-field-37" class="ninja-forms-field nf-element nf-checked" value="Physical Product" aria-labelledby="nf-label-class-field-37-0">
<label for="nf-field-37-0" id="nf-label-class-field-37-0" class="nf-checked-label">Physical Product</label>
</li>
<li>
<input type="radio" id="nf-field-37-1" name="nf-field-37" class="ninja-forms-field nf-element" value="Digital Product" aria-labelledby="nf-label-class-field-37-1">
<label for="nf-field-37-1" id="nf-label-class-field-37-1" class="">Digital Product</label>
</li>
<li>
<input type="radio" id="nf-field-37-2" name="nf-field-37" class="ninja-forms-field nf-element" value="Subscription" aria-labelledby="nf-label-class-field-37-2">
<label for="nf-field-37-2" id="nf-label-class-field-37-2" class="">Subscription</label>
</li>
<li>
<input type="radio" id="nf-field-37-3" name="nf-field-37" class="ninja-forms-field nf-element" value="Service" aria-labelledby="nf-label-class-field-37-3">
<label for="nf-field-37-3" id="nf-label-class-field-37-3" class="">Service</label>
</li>
</ul></div>


this class is added to input when clicked



nf-checked


and this class is added to label when clicked



nf-checked-label









share|improve this question
















I've made my radio buttons to full width, which wrap around the text, making entire text a radio button.



This is the code I used to make radio buttons look like buttons:



.list-checkbox-wrap .nf-field-element li label, .list-radio-wrap .nf- 
field-element li label {
margin-left:0em;}

label.radio {
cursor: pointer;
}

label.radio input {
position: absolute;
top: 0;
left: 0;
visibility: hidden;
pointer-events: none;
}


.list-checkbox-wrap .nf-field-element li label, .list-radio-wrap .nf-
field-element li label {
padding: 7px 14px;
border: 2px solid #EEE;
display: inline-block;
color: #009BA2;
border-radius: 3px;
text-transform: uppercase;
text-align:center;
}

input[type=checkbox], input[type=radio] {
visibility: hidden;
margin: 0;
width: 0!important;
}

input[type=checkbox] + label, input[type=radio] + label {
font-size: 16px;
}

input[type=checkbox] + label:hover, input[type=radio] + label:hover {
cursor: pointer; }

input[type=checkbox] + label:before, input[type=radio] + label:before{
font-family: "ETmodules";
font-size: 36px;
position: relative;
top: 0.3em;
margin-right: 0.2em;
}


However, I cannot manage to change border-color of box when radio button is selected.



html for radio buttons



<div class="nf-field-element"><ul aria-describedby="nf-error-37">

<li>
<input type="radio" id="nf-field-37-0" name="nf-field-37" class="ninja-forms-field nf-element nf-checked" value="Physical Product" aria-labelledby="nf-label-class-field-37-0">
<label for="nf-field-37-0" id="nf-label-class-field-37-0" class="nf-checked-label">Physical Product</label>
</li>
<li>
<input type="radio" id="nf-field-37-1" name="nf-field-37" class="ninja-forms-field nf-element" value="Digital Product" aria-labelledby="nf-label-class-field-37-1">
<label for="nf-field-37-1" id="nf-label-class-field-37-1" class="">Digital Product</label>
</li>
<li>
<input type="radio" id="nf-field-37-2" name="nf-field-37" class="ninja-forms-field nf-element" value="Subscription" aria-labelledby="nf-label-class-field-37-2">
<label for="nf-field-37-2" id="nf-label-class-field-37-2" class="">Subscription</label>
</li>
<li>
<input type="radio" id="nf-field-37-3" name="nf-field-37" class="ninja-forms-field nf-element" value="Service" aria-labelledby="nf-label-class-field-37-3">
<label for="nf-field-37-3" id="nf-label-class-field-37-3" class="">Service</label>
</li>
</ul></div>


this class is added to input when clicked



nf-checked


and this class is added to label when clicked



nf-checked-label






css wordpress radio-button ninja-forms






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 19 '18 at 1:35







Mike Finocchiaro

















asked Nov 18 '18 at 23:39









Mike FinocchiaroMike Finocchiaro

335




335













  • Can you please provide relevant HTML code as you are using other classes too (seems like outer elements)

    – iamshahid
    Nov 19 '18 at 0:16



















  • Can you please provide relevant HTML code as you are using other classes too (seems like outer elements)

    – iamshahid
    Nov 19 '18 at 0:16

















Can you please provide relevant HTML code as you are using other classes too (seems like outer elements)

– iamshahid
Nov 19 '18 at 0:16





Can you please provide relevant HTML code as you are using other classes too (seems like outer elements)

– iamshahid
Nov 19 '18 at 0:16












1 Answer
1






active

oldest

votes


















0














Found how to target the checked radio button css



input[type=radio]:checked + label {
...code here
}





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53366546%2fshowed-checked-radio-button-ninja-forms%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Found how to target the checked radio button css



    input[type=radio]:checked + label {
    ...code here
    }





    share|improve this answer




























      0














      Found how to target the checked radio button css



      input[type=radio]:checked + label {
      ...code here
      }





      share|improve this answer


























        0












        0








        0







        Found how to target the checked radio button css



        input[type=radio]:checked + label {
        ...code here
        }





        share|improve this answer













        Found how to target the checked radio button css



        input[type=radio]:checked + label {
        ...code here
        }






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 19 '18 at 1:52









        Mike FinocchiaroMike Finocchiaro

        335




        335






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53366546%2fshowed-checked-radio-button-ninja-forms%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Guess what letter conforming each word

            Port of Spain

            Run scheduled task as local user group (not BUILTIN)