Field Variables: radio input

Home Forums Quform WordPress Field Variables: radio input

This topic is: resolved
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #31052
    DUALWERK
    Participant

    Hello,

    I am refering to this post which is marked as resolved: https://support.themecatcher.net/forums/topic/field-variables

    I tried to apply this for the radio input element with images. But it does not work.

    Here is my code:

    JS:

    jQuery(document).ready(function ($) {
        $('.quform-field-2_50').bind('keyup blur', function () {
            var rVal = $(".quform-field-2_50:checked").val();
            if(rVal){ $('#terminart').text(rVal); }
            console.log(rVal);
        });
    }); 

    HTML:
    <span id="terminart"></span>

    Seems like the bind event does not trigger because I don’t even get the console log. Does it work differently for radio inputs?

    Thanks in advance!

    • This topic was modified 3 years, 12 months ago by DUALWERK.
    #31054
    DUALWERK
    Participant

    I found a solution:

        
    $('.quform-field-2_28').change(function() {
            $('#mitarbeiter').text($(this).filter(':checked').val());
    });
    

    This does only work if there is no pre-selected option. To solve this you could do something likes this:

    
    var rVal = $('.quform-field-2_28').filter(':checked').val();  
    $('.quform-field-2_28').change(function() {
            rVal = $(this).filter(':checked').val();
            $('#mitarbeiter').text(rVal);
    });
    
    #31059
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy