0

I have a form with three labels. How can I select all labels by checkbox?

    <div class="row">
        <div class="small-11 small-centered columns">
            <form>
                <fieldset>
                    <legend><h4>Форми участі</h4></legend>
                    <label>
                        Секція
                        <input type="text" placeholder="введіть текст">
                    </label>
                    <label>
                        Назва доповіді
                        <input type="text" placeholder="введіть текст">
                    </label>
                    <label>
                        Необхідні технічні засоби
                        <input type="text" placeholder="введіть текст">
                    </label>
                </fieldset>
            </form>
        </div>
    </div>

something like this https://i.stack.imgur.com/nc8WD.png. If it checked that will pick out all options.

cygnus
  • 3
  • 4

2 Answers2

0

Make a <div> around your inputs. Above the checkbox. Than you can access the <div> with CSS, like: #myCheckbox:checked + div. + selector selects all <div> that are placed immediately after #myCheckbox.

Example

0

You will need to write some JavaScript:

function setValues(newValue) {
    var input = document.getElementById("changeMe");
    for(i = 0;i < input.length; i++) {
        input[i].value = newValue;
    }
}

You will need a checkbox:

<input type="checkbox" id="changeMe" name="someName" value="" onClick="setValues('Форми участі')"> Some Text!

I have not been able to test this, but it should work!

jewettg
  • 1,098
  • 11
  • 20