如何创建动态下拉框 [英] How to create a dynamic drop down box
本文介绍了如何创建动态下拉框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了一个带有动态下拉框的php表单,它从数据库中提取选项。这些框工作正常,数据提交得很好,但我有一个问题是将框默认为我从数据库中选择的记录。 (记录1 =无)。
这是我所做的代码。
I have created a php form with dynamic drop down boxes in it which pull the options from a database. The boxes work fine and the data gets submitted fine but im having a problem getting the box to default to a record of my choice from the database. (record 1 = None).
Here is the code to what i have done.
展开 | 选择 | 换行 | 行号
推荐答案
我创建了一个带有动态下拉框的php表单,它从数据库中提取选项。这些框工作正常,数据提交得很好,但我有一个问题是将框默认为我从数据库中选择的记录。 (记录1 =无)。
这是我所做的代码。
[php]
< input maxLength =" ; 40"大小= QUOT; 30英寸; name =" name">< / td>
< / tr>
< tr>
< td width = QUOT; 286" height =" 22">< b>参与的人:< / b>< / td>
< td align =" left"宽度= QUOT; 365" height =" 24">< select name =" person_involved">
<?php
hesk_dbConnect() ;
I have created a php form with dynamic drop down boxes in it which pull the options from a database. The boxes work fine and the data gets submitted fine but im having a problem getting the box to default to a record of my choice from the database. (record 1 = None).
Here is the code to what i have done.
[php]
<input maxLength="40" size="30" name="name"></td>
</tr>
<tr>
<td width="286" height="22"><b>Person Involved:</b></td>
<td align="left" width="365" height="24"><select name="person_involved">
<?php
hesk_dbConnect();
sql =" SELECT * FROM`hesk_involved` ORDER BY`name`ASC" ;;
sql = "SELECT * FROM `hesk_involved` ORDER BY `name` ASC";
结果= hesk_dbQuery(
result = hesk_dbQuery(
这篇关于如何创建动态下拉框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文