选择的索引使用html5更改问题& php< select> [英] Selected index Change question with html5 & php <select>
问题描述
我将有两个下拉菜单如下:
第一个下拉菜单将包含预先确定的业务列表类别,第二个将填充所选类别的所有业务'仅在从第一个下拉列表中选择一个类别后。
这是一个背后的一般概念我正在使用的类别:
I will have two drop down menu's like this:
The first drop down menu will have a list of pre determined business categories, the second will populate all of the business' listed for the selected category only after a category is selected from the first dropdown.
This is a general idea behind the categories I am using:
<select id="category">
<option>Restauraunts</option>
<option>Legal</option>
<option>Fitness</option>
<option>Motorcycle</option>
<option>Sports</option>
</select>
每个选项都是商业类别。用户将从首页上的选择框中选择一个类别。它将在数据库中查询该类别中列出的所有业务,并将这些业务名称加载到第一个下方同一页面上的第二个选择框中。
我正在寻找如何做到这一点的方向。我是新手,谢谢你的帮助!
Each one of the selections will be a business category. A user will select a category from the select box on my front page. It will query the database for all business's listed in that category and load those business names into a second select box on the same page below the first.
I am looking for direction on how to do this. I am new to this, thank you for the help!
推荐答案
看看这个:根据下拉选择填充数据库中的另一个选择下拉列表 [ ^ ]
除此之外PHP,你还必须学习SQL。
Check this out: Populate another select dropdown from database based on dropdown selection[^]
Besides PHP, you also have to learn SQL.
这篇关于选择的索引使用html5更改问题& php< select>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!