如何制作带有自定义复选框的表单,该复选框会将我定向到提交表单上的不同html文件?

时间:2019-05-31 01:26:59

标签: javascript html uwp

我有一个带有自定义复选框的表单,我想保留对其他html页面的引用。我希望用户选择其中一个复选框,然后单击底部的开始按钮。应该发生的是,它将把用户带到附加到复选框的html文件中。我知道这可能没有道理,因此请转到该网站的web版本以了解我要做什么。

    <form method="post">
    <div class="form-row">
        <div class="col-sm-1">
        </div>
        <div class="col-sm">
            <div class="media">
                <img src="https://www.mometrix.com/academy/wp-content/uploads/2017/12/Algebra-I-1024x683.jpg" class="mr-3" alt="" width="150" height="150">
                <div class="media-body">
                    <h5 class="mt-0">Algebra</h5>
                    <div class="custom-control custom-switch">
                        <input type="checkbox" class="custom-control-input" id="customSwitch1" name="AL">
                        <label class="custom-control-label" for="customSwitch1"></label>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm">
            <div class="media">
                <img src="https://www.wikihow.com/images/thumb/a/ae/Find-Area-and-Perimeter-Step-7-Version-2.jpg/aid3987529-v4-728px-Find-Area-and-Perimeter-Step-7-Version-2.jpg" class="mr-3" alt="..." width="150" height="150">
                <div class="media-body">
                    <h5 class="mt-0">Area &amp; Perimeter</h5>
                    <div class="custom-control custom-switch">
                        <input type="checkbox" class="custom-control-input" id="customSwitch2" name="AP">
                        <label class="custom-control-label" for="customSwitch2"></label>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-12">
        </div>
    </div>
    <div class="form-row">
        <div class="col-sm-1">
        </div>
        <div class="col-sm">
            <div class="media">
                <img src="https://www.mathsisfun.com/numbers/images/arithmetic.svg" class="mr-3" alt="..." width="150" height="150">
                <div class="media-body">
                    <h5 class="mt-0">Arithmetic</h5>
                    <div class="custom-control custom-switch">
                        <input type="checkbox" class="custom-control-input" id="customSwitch3" name="AR">
                        <label class="custom-control-label" for="customSwitch3"></label>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm">
            <div class="media">
                <img src="https://www.mathsisfun.com/algebra/images/exponent-8-2.svg" class="mr-3" alt="..." width="150" height="150">
                <div class="media-body">
                    <h5 class="mt-0">Exponents</h5>
                    <div class="custom-control custom-switch">
                        <input type="checkbox" class="custom-control-input" id="customSwitch4" name="EX">
                        <label class="custom-control-label" for="customSwitch4"></label>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-12">
        </div>
    </div>
    <div class="form-row">
        <div class="col-sm-1">
        </div>
        <div class="col-sm">
            <div class="media">
                <img src="https://dmzn2b8hkpq8b.cloudfront.net/images/products/515x515/S411589.jpg" class="mr-3" alt="..." width="150" height="150">
                <div class="media-body">
                    <h5 class="mt-0">Geometric Solids</h5>
                    <div class="custom-control custom-switch">
                        <input type="checkbox" class="custom-control-input" id="customSwitch5" name="GS">
                        <label class="custom-control-label" for="customSwitch5"></label>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm">
            <div class="media">
                <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAP0AAADHCAMAAADlCqUFAAACLlBMVEX7+/y7AB5mAP8zzAD/mQD///8wyQD9lgBjAPwxzAD/oAD8lwCzAA28AB1RANdsRQBnAPknswAtEWtaPAH0nQAguABbAAK/ABu+ABigAAC2AAAAAAD4+PmvAAC8ABKYAADGABnMzMyqAACutLTd4uKRAAC8AADc3Nzq7O2KioqJAAAy0gDN1NSHh4dUVFRLS0uXl5dkZGSnpOh1dXX58fTAxMR4AACjAArz3+OBAAAAAMzr6vjBAA6ss7OmqKjp9urh8+I9AACnABk5OTl7AA0/xj+RX2RQy1CKNj0XFxdy0XNWQELJAABcXFxlAADKABKDFCAtLS2LdXcAQQAAdAAAWACXABTZhpHmtbxzJCtDLy+/HDKIABeJJzBPKSzE68QASwBnX2pMRNZvRUhaUtjMyvGEf+ChX19QSVJEALmTjJRBIwAOhgDLZ21nVFMfNSDliwAkAHUcFT54ct4AACEAADssHy/FQE9vc2UUjABbAOQeogAfKyE7AKKlSEcJGA0kDgDScXykYQAeIiq/dAC3tOssKkEQAEzou8J/dYPel6EvISCLTwBV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/xAHYu3t3pxEDOivt33Np39CrsafpK1NMASEaufz5F7c/urZ7717TCmz0HBc45evvnkxKT43JlwqAENRTl//8FRmCa9deRHney3H86VOnQn2+0e6/zKua/HSiGwIASlhTY8n5uT//x988//wH3QsL3bnHc8lkTI/KwtP7NVkFoYiCHI4GUaJEZFnwPPXfkFYiYJcn3ZmfZafK/wNR3hEq33bDmgAAAABJRU5ErkJggg==" class="mr-3" alt="..." width="150" height="150">
                <div class="media-body">
                    <h5 class="mt-0">Probability</h5>
                    <div class="">
                        <input type="checkbox" class="custom-control-input" id="customSwitch6" name="PR">
                        <label class="custom-control-label" for="customSwitch6"></label>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-12">
        </div>
    </div>
    <div class="form-row">
        <div class="col-sm-1">
        </div>
        <div class="col-sm">
            <div class="media">
                <img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTDvygQLpB_G08iwALHg6N6rIEm1abgLnEQKZF0Qn6QOZFQDYWP" class="mr-3" alt="..." width="150" height="150">
                <div class="media-body">
                    <h5 class="mt-0">Systems of Equations</h5>
                    <div class="custom-control custom-switch">
                        <input type="checkbox" class="custom-control-input" id="customSwitch7" name="SE">
                        <label class="custom-control-label" for="customSwitch7"></label>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm">
            <div class="media">
                <img src="http://home.windstream.net/okrebs/Ch8-28.gif" class="mr-3" alt="..." width="150" height="150">
                <div class="media-body">
                    <h5 class="mt-0">Trig Statements</h5>
                    <div class="custom-control custom-switch">
                        <input type="checkbox" class="custom-control-input" id="customSwitch8" name="TR">
                        <label class="custom-control-label" for="customSwitch8"></label>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-12">
        </div>
    </div>
    <center>
        <button type="submit" class="btn btn-outline-success">Start</button>
    </center>
</form>

2 个答案:

答案 0 :(得分:0)

我做了一些小改动
1 _将每个页面的数据页添加到带有页面网址的复选框。
2 _在表单

中添加 ID

document.addEventListener("DOMContentLoaded", function()
{
  const
    MyForm       = document.getElementById('My-Form'),
    all_checkBox = document.querySelectorAll('#My-Form input[type=checkbox]'),
    SubmitBt     = document.querySelector('#My-Form button[type=submit]');

  all_checkBox.forEach(chkBx=>{ chkBx.onchange = ChkBxChanged })

  SubmitBt.disabled = true;

  function ChkBxChanged(e)
  {
    MyForm.action = '';
    SubmitBt.disabled = true;

    if ( this.checked )
    {
      MyForm.action     = this.dataset.page;
      SubmitBt.disabled = false;

      all_checkBox.forEach(cb=>{
        if (cb!=this) cb.checked = false   // only one should be checked
      })
    }
  }
})
<form id="My-Form" action="" method="POST" >

  <h5 class="mt-0">Algebra</h5>
  <input type="checkbox" class="custom-control-input" id="customSwitch1" name="AL" data-page="Algebra.html" >

  <h5 class="mt-0">Area &amp; Perimeter</h5>
  <input type="checkbox" class="custom-control-input" id="customSwitch2" name="AP" data-page="Area_Perimeter.html" >

  <h5 class="mt-0">Arithmetic</h5>
  <input type="checkbox" class="custom-control-input" id="customSwitch3" name="AR" data-page="Arithmetic.html" >

  <h5 class="mt-0">Exponents</h5>
  <input type="checkbox" class="custom-control-input" id="customSwitch4" name="EX" data-page="Exponents.html" >

  <h5 class="mt-0">Geometric Solids</h5>
  <input type="checkbox" class="custom-control-input" id="customSwitch5" name="GS" data-page="Geometric_Solids.html" >

  <h5 class="mt-0">Probability</h5>
  <input type="checkbox" class="custom-control-input" id="customSwitch6" name="PR" data-page="Probability.html" >

  <h5 class="mt-0">Systems of Equations</h5>
  <input type="checkbox" class="custom-control-input" id="customSwitch7" name="SE" data-page="Equations.html" >

  <h5 class="mt-0">Trig Statements</h5>
  <input type="checkbox" class="custom-control-input" id="customSwitch8" name="TR" data-page="Trig_Statements.html" >

  <button type="submit" class="btn btn-outline-success">Start</button>

</form>

答案 1 :(得分:0)

这是我为您提供给Jojo先生的代码所做的

    <script>

    const
        MyForm = document.getElementById('My-Form'),
        all_checkBox = document.querySelectorAll('#My-Form input[type=checkbox]'),
        SubmitBt = document.querySelector('#My-Form button[type=submit]');

    all_checkBox.forEach(chkBx => { chkBx.onchange = ChkBxChanged })

    SubmitBt.disabled = true;

    function ChkBxChanged(e) {
        MyForm.action = '';
        SubmitBt.disabled = true;

        if (this.checked) {
            MyForm.action = this.dataset.page;
            SubmitBt.disabled = false;

            all_checkBox.forEach(cb => {
                if (cb != this) cb.checked = false   // only one should be checked
            })
        }
    }
</script>
<form id="My-Form" action="" method="POST">

    <h5 class="mt-0">Algebra</h5>
    <input type="checkbox" class="custom-control-input" id="customSwitch1" name="AL" data-page="index.html">

    <h5 class="mt-0">Area &amp; Perimeter</h5>
    <input type="checkbox" class="custom-control-input" id="customSwitch2" name="AP" data-page="index.html">

    <h5 class="mt-0">Arithmetic</h5>
    <input type="checkbox" class="custom-control-input" id="customSwitch3" name="AR" data-page="index.html">

    <h5 class="mt-0">Exponents</h5>
    <input type="checkbox" class="custom-control-input" id="customSwitch4" name="EX" data-page="index.html">

    <h5 class="mt-0">Geometric Solids</h5>
    <input type="checkbox" class="custom-control-input" id="customSwitch5" name="GS" data-page="index.html">

    <h5 class="mt-0">Probability</h5>
    <input type="checkbox" class="custom-control-input" id="customSwitch6" name="PR" data-page="index.html">

    <h5 class="mt-0">Systems of Equations</h5>
    <input type="checkbox" class="custom-control-input" id="customSwitch8" name="SE" data-page="index.html">
        <button type="submit" class="btn btn-outline-success">Start</button>

</form>