Support » Plugin: Participants Database » Radio buttons reset

  • eljailer

    (@eljailer)


    Hello xnau!!!
    Is there a way to clear radio button selections?
    I’m thinking something like this: <form><input type=”radio” name=”v1″ value=”A”/>A
    <input type=”radio” name=”v1″ value=”B”/>B
    <input type=”reset”/></form>.
    Where do I put this code? Is there a better way to do it?
    Thanx 🙂

    https://wordpress.org/plugins/participants-database/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author xnau webdesign

    (@xnau)

    In order to “clear” radio button selections, you have to use javascript. You can easily set up a radio button that represents a cleared state for the field, but without javascript, you can’t deselect all radio buttons.

    How to set up the javascript? You need to decide how you want that to work, then attach a handler to the action (such as clicking on a button or the word “clear”) that clears the radio buttons. A quick web search will give you the details, it’s not difficult.

    eljailer

    (@eljailer)

    Thank you for swift reply!

    eljailer

    (@eljailer)

    Hi xnau!
    It’s me again… Still having problems… :/
    I found a script that does exactly what I need, but it doesn’t work.
    Where do I put the code? I tried directly into the page that contains pdb_record shortcode, but won’t work.
    This is the script:`<script type=”text/javascript”>
    jQuery(document).ready(function($){
    $(‘input[name=”item_meta[button1]”]’).change(function(){
    $(‘input[name=”item_meta[button2]”]’).prop(‘checked’,false);
    $(‘input[name=”item_meta[button3]”]’).prop(‘checked’,false);
    $(‘input[name=”item_meta[button4]”]’).prop(‘checked’,false);
    $(‘input[name=”item_meta[button5]”]’).prop(‘checked’,false);
    $(‘input[name=”item_meta[button6]”]’).prop(‘checked’,false);
    });
    });
    </script>`.
    Should I put this code in pdb-record.php?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Radio buttons reset’ is closed to new replies.