简体   繁体   English

如何在select onChange事件上重定向到其他方式?

[英]How to redirect to other way on a select onChange event?

I'm trying to make a product browser selection interface that when I click the selection of productType in the column1 , the column2 will appear the product with the selected productType by fetching information in the database ( SELECT productName from products WHERE productTYPE = 1 ). 我正在尝试创建一个产品浏览器选择界面,当我单击column1的productType选项时, column2将通过获取数据库中的信息( SELECT productName from products WHERE productTYPE = 1显示具有所选productType的SELECT productName from products WHERE productTYPE = 1

I've done it with ajax, but it turns out ajax is not permitted in this assignment(really sad!) 我用ajax完成了它,但事实证明这个任务中不允许使用ajax(真的很难过!)

I can't come up with the solution without ajax. 没有ajax,我无法想出解决方案。 So Is there any way to make a post/get request with parameter and redirect to the self page(with self-post technique), only after I select a productType in the column1(onChange event on select element) 那么,只有在我选择column1中的productType(select元素的onChange事件)之后,才有办法用参数创建一个post / get请求并重定向到自己的页面(使用自发后技术)

在此输入图像描述

What if you just outputted all the Products in a single select when you load the page and hide all the options by default then you can unhide the correct ones when you select a Product Line from column1. 如果您在加载页面时仅在一个选择中输出所有产品并默认隐藏所有选项,那么当您从column1中选择产品线时,您可以取消隐藏正确的选项。

A second option is to put multiple selects on the page when load, one for each Product Line and then hide all those selects by default and show/hide them as the appropriate column1 is selected. 第二个选项是在加载时在页面上放置多个选项,每个产品系列一个选项,然后默认隐藏所有选择,并在选择适当的column1时显示/隐藏它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM