Advertisement
Guest User

HTMLOnTop

a guest
Mar 27th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.53 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <script runat="server">
  4.  
  5. </script>
  6.  
  7. <head runat="server">
  8. <script src="userValidate.js"></script>
  9. <title></title>
  10. <link type="text/css" rel="stylesheet" href="StyleSheet.css" >
  11. </head>
  12. <body>
  13.  
  14.  
  15.  
  16. <div id="header">
  17. <h1>Suncoast High School Guidance Department</h1>
  18. </div>
  19.  
  20. <div id="nav">
  21. <a style="text-decoration: none; color: black;" id = "home" href="Default.aspx">Home</a><br />
  22. <a style="text-decoration: none; color: black;" id = "login" href="Login.aspx">Login</a><br />
  23. <a style="text-decoration: none; color: black;" id = "Ask a Question" href="Ask a Question.aspx">Ask a Question</a><br />
  24. <a style="text-decoration: none; color: black;" id = "FAQs" href="FAQs.aspx">FAQs</a><br />
  25. <a style="text-decoration: none; color: black;" id = "Search" href="Search.aspx">Search</a><br />
  26. <a style="text-decoration: none; color: black;" id = "General Info" href="General Info.aspx">General Info</a><br />
  27. </div>
  28. <form id="form1" runat="server">
  29. <div id="section">
  30. <h1>Sign Up</h1>
  31.  
  32. <form id="studentInfo">
  33.  
  34. First Name:<br>
  35. <input type="text" id="fname"><br>
  36. Last Name:<br>
  37. <input type="text" id="lname"><br>
  38. Email:<br>
  39. <input type="text" id="email"><br>
  40. <input type="submit" value="Submit" onclick="doSomething()" id="studentInfoSubmit">
  41.  
  42.  
  43. </form>
  44. </form>
  45.  
  46. </body>
  47.  
  48. <script>
  49.  
  50. function doSomething() {
  51. var fname = document.getElementById('fname').value;
  52. var lname = document.getElementById('lname').value;
  53. var email = document.getElementById('email').value;
  54. alert("First Name: " + fname + "\nLast Name: " + lname + "\nEmail: " + email)
  55. }
  56.  
  57. </script>
  58.  
  59. </html>
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67. function userValidation()
  68. {
  69. alert("you have made an account, please login");
  70. var userName = document.form1.username.value;
  71. var email = document.form1.Email.value;
  72. alert(email);
  73. var password = document.form1.password.value;
  74. alert(userName + email + password);
  75. var foundError = false;
  76.  
  77.  
  78. if (username == "") {
  79. foundError = true;
  80. document.getElementById("usernameError").innerHTML = "Username is required.";
  81. }
  82. else {
  83. document.getElementById("passwordError").innerHTML = "&nbsp ";
  84. }
  85.  
  86. if (email == "") {
  87. foundError = true;
  88. document.getElementById("emailError").innerHTML = "Email is required.";
  89. }
  90. else if (email.indexOf("@") == -1) {
  91. foundError = true;
  92. document.getElementById("emailError").innerHTML = "Email must contain an @ symbol.";
  93. document.form1.Email.value = "";
  94. }
  95. else {
  96. document.getElementById("emailError").innerHTML = "&nbsp";
  97. }
  98.  
  99. if (password == "") {
  100. foundError = true;
  101. document.getElementById("passwordError").innerHTML = "Password is required.";
  102. }
  103. else {
  104. document.getElementById("passwordError").innerHTML = "&nbsp ";
  105. }
  106.  
  107. if (foundError) {
  108. return false;
  109. }
  110. else {
  111. return true;
  112. }
  113. }
  114. var connection = new ActiveXObject("ADODB.Connection");
  115.  
  116. var connectionstring = "Data Source=localhost\SQLEXPRESS;Initial Catalog=Senior Project NK;Integrated Security=SSPI";
  117. var DSHtest = String;
  118.  
  119. connection.Open(connectionstring);
  120. var rs = new ActiveXObject("ADODB.Recordset");
  121.  
  122. rs.Open("SELECT * FROM dbo.Issues", connection);
  123. rs.
  124. rs.MoveFirst
  125. rs.find(password);
  126. DSHtest = rs.fields(1).value;
  127. while (!rs.eof) {
  128. document.write(rs.fields(1));
  129. rs.movenext;
  130. }
  131.  
  132. rs.close;
  133. connection.close;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement