如何使用样式来选择使用JQuery UI

时间:2016-06-28 03:13:03

标签: javascript jquery css jsp

我一直在尝试添加样式,以便在我的jsp文件中使用JQuery UI进行选择。但我无法这样做。我已经看了很多教程,还看了JQuery官方网站为selectmenu提供的演示,但是我无法在我的选择菜单中这样做。我链接到我的JQuery UI文件是否正确可以请有人告诉我上面的代码有什么问题。提前致谢

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import= "java.util.*,java.Date.*,java.sql.*"%>
<%@page import= "javax.servlet.*,javax.servlet.http.*"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="CSS/call_for_report.css"/>
    <!-- References to JQuery UI packages goes here -->
    <script src="JQ-UI/jquery-ui.js" type="text/javascript"></script>
    <script src="JQ-UI/external/jquery/jquery.js" type="text/javascript"></script>
    <link href="JQ-UI/jquery-ui.css" rel="stylesheet"/>

    <title>Call For Report</title>

    <script type="text/javascript">
        $(document).ready(function(){
            $('#field_name').selectmenu() ;
        }) ;
    </script>
</head>
<body>

<sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver"
                   url ="jdbc:mysql://localhost/kn"
                   user ="root" password="password"/>

 <sql:query dataSource="${snapshot}" var="result">
        SELECT name FROM sites ;
 </sql:query>

    <fieldset>

        <form onsubmit="" action="view.jsp" method="JSP">

            <center>

            <h2 id="heading">
                <u><i>Select a Button For Viewing</i></u>
            </h2>   

                <div id="field_menu">
                <label for="field_name">Select The Field Name</label>
                <select name="field_name" id="field_name" style="width: 150px;">
                    <c:forEach var="row" items="${result.rows}">
                        <option><c:out value="${row.name}"/></option>
                    </c:forEach>
                </select>
                </div>

            <div>
                <input type="submit" value ="Production Report" class="styling" name="view" id="top_button">
                <input type="submit" value ="Work Over History" class="styling" name="view">
            </div>

            <div>
                <input type="submit" value="Crane Job History" class="styling" name="view">
                <input type="submit" value="Well Sickness History" class="styling" name="view">
            </div>

            <input type="submit" value="Liquid Level History" class="styling" name="view" id="bottom_button">

            </center>
        </form>
    </fieldset>

</body>

0 个答案:

没有答案