diff --git a/src/application/views/user/forgot_password.php b/src/application/views/user/forgot_password.php index 78b38bfe..f543ce70 100644 --- a/src/application/views/user/forgot_password.php +++ b/src/application/views/user/forgot_password.php @@ -73,7 +73,7 @@ * Make an ajax call to the server and check whether the user's credentials are right. * If yes then redirect him to his desired page, otherwise display a message. */ - $('form').submit(function() { + $('form').submit(function(event) { event.preventDefault(); var postUrl = GlobalVariables.baseUrl + 'user/ajax_forgot_password'; diff --git a/src/application/views/user/login.php b/src/application/views/user/login.php index 0c5fdc6e..c783db53 100644 --- a/src/application/views/user/login.php +++ b/src/application/views/user/login.php @@ -82,7 +82,7 @@ * Make an ajax call to the server and check whether the user's credentials are right. * If yes then redirect him to his desired page, otherwise display a message. */ - $('#login-form').submit(function() { + $('#login-form').submit(function(event) { event.preventDefault(); var postUrl = GlobalVariables.baseUrl + 'user/ajax_check_login'; diff --git a/src/assets/js/backend_customers.js b/src/assets/js/backend_customers.js index f4275d03..3702bba5 100644 --- a/src/assets/js/backend_customers.js +++ b/src/assets/js/backend_customers.js @@ -60,12 +60,12 @@ CustomersHelper.prototype.bindEventHandlers = function() { /** * Event: Filter Customers Form "Submit" */ - $('#filter-customers form').submit(function() { - event.preventDefault(); + $('#filter-customers form').submit(function(event) { var key = $('#filter-customers .key').val(); $('#filter-customers .selected-row').removeClass('selected-row'); BackendCustomers.helper.resetForm(); BackendCustomers.helper.filter(key); + return false; }); /** diff --git a/src/assets/js/backend_services.js b/src/assets/js/backend_services.js index 92e29a2d..d855e8e2 100644 --- a/src/assets/js/backend_services.js +++ b/src/assets/js/backend_services.js @@ -116,12 +116,12 @@ ServicesHelper.prototype.bindEventHandlers = function() { /** * Event: Filter Services Form "Submit" */ - $('#filter-services form').submit(function() { - event.preventDefault(); + $('#filter-services form').submit(function(event) { var key = $('#filter-services .key').val(); $('#filter-services .selected-row').removeClass('selected-row'); BackendServices.helper.resetForm(); BackendServices.helper.filter(key); + return false; }); /** @@ -343,7 +343,6 @@ ServicesHelper.prototype.resetForm = function() { $('#filter-services .selected-row').removeClass('selected-row'); $('#filter-services button').prop('disabled', false); $('#filter-services .results').css('color', ''); - $('#filter-services .key').val(''); }; /** @@ -478,12 +477,12 @@ CategoriesHelper.prototype.bindEventHandlers = function() { /** * Event: Filter Categories Form "Submit" */ - $('#filter-categories form').submit(function() { - event.preventDefault(); + $('#filter-categories form').submit(function(event) { var key = $('#filter-categories .key').val(); $('.selected-row').removeClass('selected-row'); BackendServices.helper.resetForm(); BackendServices.helper.filter(key); + return false; }); /** @@ -724,7 +723,6 @@ CategoriesHelper.prototype.resetForm = function() { $('#filter-categories .selected-row').removeClass('selected-row'); $('#filter-categories .results').css('color', ''); $('#filter-categories button').prop('disabled', false); - $('#filter-categories .key').val(''); }; /** diff --git a/src/assets/js/backend_users_admins.js b/src/assets/js/backend_users_admins.js index e3146b08..2e978197 100644 --- a/src/assets/js/backend_users_admins.js +++ b/src/assets/js/backend_users_admins.js @@ -18,12 +18,12 @@ AdminsHelper.prototype.bindEventHandlers = function() { * * Filter the admin records with the given key string. */ - $('#filter-admins form').submit(function() { - event.preventDefault(); + $('#filter-admins form').submit(function(event) { var key = $('#filter-admins .key').val(); $('#filter-admins .selected-row').removeClass('selected-row'); BackendUsers.helper.resetForm(); BackendUsers.helper.filter(key); + return false; }); /** diff --git a/src/assets/js/backend_users_providers.js b/src/assets/js/backend_users_providers.js index 9b4a38c7..c927f82a 100644 --- a/src/assets/js/backend_users_providers.js +++ b/src/assets/js/backend_users_providers.js @@ -18,12 +18,12 @@ ProvidersHelper.prototype.bindEventHandlers = function() { * * Filter the provider records with the given key string. */ - $('#filter-providers form').submit(function() { - event.preventDefault(); + $('#filter-providers form').submit(function(event) { var key = $('#filter-providers .key').val(); $('.selected-row').removeClass('selected-row'); BackendUsers.helper.resetForm(); BackendUsers.helper.filter(key); + return false; }); /** diff --git a/src/assets/js/backend_users_secretaries.js b/src/assets/js/backend_users_secretaries.js index c1fef750..4b404f16 100644 --- a/src/assets/js/backend_users_secretaries.js +++ b/src/assets/js/backend_users_secretaries.js @@ -18,12 +18,12 @@ SecretariesHelper.prototype.bindEventHandlers = function() { * * Filter the secretary records with the given key string. */ - $('#filter-secretaries form').submit(function() { - event.preventDefault(); + $('#filter-secretaries form').submit(function(event) { var key = $('#filter-secretaries .key').val(); $('#filter-secretaries .selected-row').removeClass('selected-row'); BackendUsers.helper.resetForm(); BackendUsers.helper.filter(key); + return false; }); /** diff --git a/src/assets/js/frontend_book.js b/src/assets/js/frontend_book.js index 3e5844c9..8eff96ab 100644 --- a/src/assets/js/frontend_book.js +++ b/src/assets/js/frontend_book.js @@ -212,9 +212,7 @@ var FrontendBook = { * once the appointment is cancelled, it will be delete from the * database. */ - $('#cancel-appointment').click(function() { - event.preventDefault(); - + $('#cancel-appointment').click(function(event) { var dialogButtons = {}; dialogButtons['OK'] = function() { if ($('#cancel-reason').val() === '') { @@ -234,6 +232,7 @@ var FrontendBook = { $('#message_box').append(''); $('#cancel-reason').css('width', '353px'); + return false; }); } @@ -244,9 +243,7 @@ var FrontendBook = { * in the meantime the selected appointment date/time wasn't reserved by * another customer or event. */ - $('#book-appointment-form').submit(function() { - event.preventDefault(); - + $('#book-appointment-form').submit(function(event) { var formData = jQuery.parseJSON($('input[name="post_data"]').val()); var postData = { @@ -284,6 +281,8 @@ var FrontendBook = { FrontendBook.getAvailableHours($('#select-date').val()); } }, 'json'); + + return false; }); },