aboutsummaryrefslogtreecommitdiffstats
path: root/csci4131/hw6/strap012_hw6/public/login.html
diff options
context:
space:
mode:
authorRossTheRoss <mstrapp@protonmail.com>2021-04-15 11:36:55 -0500
committerRossTheRoss <mstrapp@protonmail.com>2021-04-15 11:36:55 -0500
commite1994b6e0342913696f94eec1a4a6b0685e3a015 (patch)
treefe065d851ca3e276c8bbc9cc78f1c6b77777c129 /csci4131/hw6/strap012_hw6/public/login.html
parentRearrange (diff)
downloadhomework-e1994b6e0342913696f94eec1a4a6b0685e3a015.tar
homework-e1994b6e0342913696f94eec1a4a6b0685e3a015.tar.gz
homework-e1994b6e0342913696f94eec1a4a6b0685e3a015.tar.bz2
homework-e1994b6e0342913696f94eec1a4a6b0685e3a015.tar.lz
homework-e1994b6e0342913696f94eec1a4a6b0685e3a015.tar.xz
homework-e1994b6e0342913696f94eec1a4a6b0685e3a015.tar.zst
homework-e1994b6e0342913696f94eec1a4a6b0685e3a015.zip
hw6
Diffstat (limited to 'csci4131/hw6/strap012_hw6/public/login.html')
-rw-r--r--csci4131/hw6/strap012_hw6/public/login.html38
1 files changed, 38 insertions, 0 deletions
diff --git a/csci4131/hw6/strap012_hw6/public/login.html b/csci4131/hw6/strap012_hw6/public/login.html
new file mode 100644
index 0000000..34bbc8c
--- /dev/null
+++ b/csci4131/hw6/strap012_hw6/public/login.html
@@ -0,0 +1,38 @@
+<html>
+
+<head>
+ <script src="https://code.jquery.com/jquery-2.2.4.min.js"integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
+</head>
+
+<body>
+ <form id="myForm" name="myForm">
+ <div>
+ <label for="login">login:</label>
+ <input type="text" id="login" name="login">
+ </div>
+ <div>
+ <label for="password">password:</label>
+ <input type="text"id="password"name="password">
+ </div>
+ <input type="submit"value="Submit!">
+ </form>
+ <script>
+ $(document).ready(function () {
+ $('#myForm').submit(function (event) {
+ event.preventDefault();//collect the form data using Id Selector for whatever data you need to send to server
+ let login=$('#login').val();
+ let password=$('#password').val();
+ $.post('logintry',
+ {"login": login,"password": password},
+ (data) => {
+ console.log(data);
+ if(data.status === 'success'){
+ //pseudo code
+ //Make sure error message is not displayed
+ //Re-direct to contacts page,
+ window.location.href='contacts';}
+ else{
+ //Display error message
+ }});});});</script>
+
+</html> \ No newline at end of file