aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdam0 <kumar.damani@mail.utoronto.ca>2017-04-15 02:26:18 +0000
committerkdam0 <kumar.damani@mail.utoronto.ca>2017-04-15 02:26:18 +0000
commit60a53ac331e33cab3173a6803dcf11de3ff47ae6 (patch)
treee972da6b41e91bde064c8827f150f399759b6bca
parentc06a7af55e7a40abc6eb12fff56851c6512e32c7 (diff)
fixed form submt on home page
-rw-r--r--assets/js/home_page.js10
-rw-r--r--views/index.hbs2
2 files changed, 11 insertions, 1 deletions
diff --git a/assets/js/home_page.js b/assets/js/home_page.js
index 4c9151a..1bc5ccf 100644
--- a/assets/js/home_page.js
+++ b/assets/js/home_page.js
@@ -1,4 +1,14 @@
function main(){
+ $("#go-button").on('click', function(e) {
+ e.preventDefault();
+ if ($("#drop-down-value").text() == "Courses") {
+ // $("#search-field").attr("action", "search/courses");
+ window.location += 'search/courses?search=' + $("#user-input-course").val();
+ } else {
+ // $("#search-field").attr("action", "search/users");
+ window.location += 'search/users?search=' + $("#user-input-users").val();
+ }
+ });
// Search bar drop down scripting (some of it is shared with nav panel
// in script.js but this code in this file is exclusive to search bar
diff --git a/views/index.hbs b/views/index.hbs
index dfb06d3..4d5f3f7 100644
--- a/views/index.hbs
+++ b/views/index.hbs
@@ -3,7 +3,7 @@
<div class="header-content">
- <form action="/search/courses" method="get" id="search-field">
+ <form action="/" method="get" id="search-field">
<section class="header-content-inner">
<p><strong>The solutions to all your problems</strong></p>
<hr> <!-- Divider -->