使用Drop-manu和按钮提交信息

时间:2016-08-25 12:45:44

标签: javascript css button radio ebay

所以我一直在这个网站上工作,我在其上的一个东西是一个表格,里面有一个 drop-manu ,还有一个额外的按钮,两者结合在一起(首先是drop-manu然后按钮),它需要转发到eBay商店搜索

这就是它的样子:

enter image description here

无论我做什么,FORM动作都行不通,我需要帮助!

这是代码在HTML中的外观:

    <!--Search For Budget-->
<section class="bg-primary searchForBudgetSec">

 <form class="container p-y-3 text-xs-center" action="http://stores.ebay.com/eyal-sasson-diamonds/_i.html" method="get" target="_blank">


        <!--Title-->
        <h3 class="font-weight-bold">SEARCH FOR BUDGET:</h3>
        <!--Sub-->
        <p class="m-b-3">Select the budget you want to spend in
                         <!--Select-->

            <select name="_fsub">
                <option value="10051314">Diamonds for Engagement Rings</option>
                <option value="10053544">Diamonds for Wedding Rings</option>
                <option value="2961128">Loose Diamonds (any shape/size)</option>
                <option value="233373">Fancy Color Diamonds</option>
                <option value="189457">Diamond for Jewelry</option>
                <option value="3414717018">GIA Diamonds</option>
                <option value="3414718018">EGL Diamonds</option>
            </select>
        </p>

        <div class="budget-search-Icons">

            <input name="LH_Price" id="u5" type="radio" value="0..500">
            <label class="btn" for="u5">

                <img alt="" src="line001.png">

                <h6>UNDER $500</h6>
            </label>

            <input name="LH_Price" id="5t1k" type="radio" value="500..1000">
            <label class="btn" for="5t1k">

                <img alt="" src="Line002.png">

                <h6>$500-$1000</h6>
            </label>

            <input name="LH_Price" id="1kt2k" type="radio" value="1000..2000">
            <label class="btn" for="1kt2k">

                <img alt="" src="Line003.png">

                <h6>$1000-$2000</h6>
            </label>

            <input name="LH_Price" id="2kt5k" type="radio" value="2000..5000">
            <label class="btn" for="2kt5k">

                <img alt="" src="Line004.png">

                <h6>$2000-$5000</h6>
            </label>

            <input name="LH_Price" id="5kt10k" type="radio" value="5000..10000">
            <label class="btn" for="5kt10k">

                <img alt="" src="Line005.png">

                <h6>$5000-$10K</h6>
            </label>

            <input name="LH_Price" id="10kt20k" type="radio" value="10000..20000">
            <label class="btn" for="10kt20k">

                <img alt="" src="Line006.png">

                <h6>$10K-$20K</h6>
            </label>

            <input name="LH_Price" id="30kA" type="radio" value="30000..100000">
            <label class="btn" for="30kA">

                <img alt="" src="Line007.png">

                <h6>$30K-ABOVE</h6>
            </label>
        </div>

    </form>
</section>

我在这里变得疯狂,因为它无论如何都无法工作!

我需要从drop-manu中选择一个项目然后选择下面的预算,然后它会在我的eBay商店中搜索这些参数,

谢谢!

1 个答案:

答案 0 :(得分:0)

这样的简单演示有效:

<section class="bg-primary searchForBudgetSec">

 <form class="container p-y-3 text-xs-center" action="http://stores.ebay.com/eyal-sasson-diamonds/_i.html" method="get" target="_blank"
id="myForm">

        <!--Title-->
        <h3 class="font-weight-bold">SEARCH FOR BUDGET:</h3>
        <!--Sub-->
        <p class="m-b-3">Select the budget you want to spend in
                         <!--Select-->

            <select name="_fsub">
                <option value="10051314">Diamonds for Engagement Rings</option>
                <option value="10053544">Diamonds for Wedding Rings</option>
                <option value="2961128">Loose Diamonds (any shape/size)</option>
                <option value="233373">Fancy Color Diamonds</option>
                <option value="189457">Diamond for Jewelry</option>
                <option value="3414717018">GIA Diamonds</option>
                <option value="3414718018">EGL Diamonds</option>
            </select>
        </p>

        <div class="budget-search-Icons">
            <input name="LH_Price" id="30kA" type="radio" value="30000..100000">
            <label class="btn" for="30kA" onclick="submitIt()">

                <img alt="" src="Line007.png">

                <h6>$30K-ABOVE</h6>
            </label>
        </div>
    </form>
</section>

<script>
function submitIt() {
    // Do some checking here.
    document.getElementById("myForm").submit();
}
</script>