Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- function myFunction() {
- var x = document.getElementById("mySelect").value;
- document.getElementById("demo").innerHTML = "You selected: " + x;
- }
- </script>
- </head>
- <body>
- <h1><center>Feed Back System</center></h1>
- <center>
- <%
- if ((session.getAttribute("userid") == null) || (session.getAttribute("userid") == "")) {
- %>
- <font size='4' color='red'>You are not logged in</font><br/>
- <a href="index.jsp">Please Login</a>
- <%} else {
- %>
- <p class="member">Welcome <%=session.getAttribute("userid")%>, you are from semester <%=session.getAttribute("category")%></p>
- <a href='logout.jsp'>Log out</a>
- <%
- }
- Class.forName("com.mysql.jdbc.Driver");
- Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/feedback","root", "");
- Statement st = con.createStatement();
- ResultSet rs;
- rs = st.executeQuery("select * from faculty");
- %>
- <form method="post" name="myform" action="feedbackform.jsp">
- <table width="480" border="0">
- <tr>
- <td colspan="3"><font color="#00FFCC" size="4">Tip :- “Select 1 for excellent 2 for better 3 for good 4 for poor”</font></td>
- </tr>
- <tr><td> </td></tr>
- <tr>
- <td width="151" class="member">Select Faculty</td>
- <td width="264" colspan="2"><select id="mySelect" onchange="myFunction()">
- <% while(rs.next()){ %>
- <option><%= rs.getString(2)%></option>
- <% } %>
- </select>
- </td>
- </tr>
- </table>
- </form>
- <p id="demo"></p>
- </center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement