问题描述
这件事真让我困扰。如何从MySQL数据库中获取下拉列表,然后将其提交到DataBase中的另一个表。我只知道如何使用html创建一个静态下拉列表但是我怎样才能使它动态化。
i在数据库中有一个表STATE现在我想填充所有的动态下拉列表中的STATE名称然后我必须将这些STATES ID保存到另一个表中作为其ID的参考
请给我解决方案代码..
谢谢
Bipendra rana
This thing is really bothering me. How can I get my dropdown list from MySQL database and then submit it to another table in DataBase. I only know how to create a static dropdown with html and but how can I make it dynamic.
i have a table STATE in Database and Now i want to populate all the STATE name in the drop down list dynamicly then i have to save these STATES ID into another table as its ID''s Refrence
Please give me the solution code for this..
thanks
Bipendra rana
推荐答案
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
<sql:query var="states">
SELECT * FROM state
</sql:query>
<form name="frmMain" id="frmMain" method="post" action="some.jsp">
<select id="lstSelect" name="lstSelect" multiple size="10">
<option value="SELECT">Select State</option>
<c:forEach var="state" items="
这篇关于从mysql数据库表中检索下拉列表,并将其再次插入数据库的jsp或servlet中的另一个表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!