Advertisement
Guest User

Untitled

a guest
Mar 5th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. <script>
  2. function myFunction() {
  3. var x = document.getElementById("mySelect").value;
  4. document.getElementById("demo").innerHTML = "You selected: " + x;
  5. }
  6. </script>
  7. </head>
  8. <body>
  9. <h1><center>Feed Back System</center></h1>
  10. <center>
  11. <%
  12. if ((session.getAttribute("userid") == null) || (session.getAttribute("userid") == "")) {
  13. %>
  14. <font size='4' color='red'>You are not logged in</font><br/>
  15. <a href="index.jsp">Please Login</a>
  16. <%} else {
  17. %>
  18. <p class="member">Welcome <%=session.getAttribute("userid")%>, you are from semester <%=session.getAttribute("category")%></p>
  19. <a href='logout.jsp'>Log out</a>
  20. <%
  21. }
  22. Class.forName("com.mysql.jdbc.Driver");
  23. Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/feedback","root", "");
  24. Statement st = con.createStatement();
  25. ResultSet rs;
  26. rs = st.executeQuery("select * from faculty");
  27. %>
  28. <form method="post" name="myform" action="feedbackform.jsp">
  29. <table width="480" border="0">
  30. <tr>
  31. <td colspan="3"><font color="#00FFCC" size="4">Tip :- &ldquo;Select 1 for excellent 2 for better 3 for good 4 for poor&rdquo;</font></td>
  32. </tr>
  33. <tr><td>&nbsp;</td></tr>
  34. <tr>
  35. <td width="151" class="member">Select Faculty</td>
  36. <td width="264" colspan="2"><select id="mySelect" onchange="myFunction()">
  37. <% while(rs.next()){ %>
  38. <option><%= rs.getString(2)%></option>
  39. <% } %>
  40. </select>
  41. </td>
  42. </tr>
  43. </table>
  44. </form>
  45. <p id="demo"></p>
  46. </center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement