$(document).ready(function() { //console.log('hi'); $('.loginFormButton').click(function() { var vals = $(this).parent().find('input, select, textarea').serialize(); $.ajax({ type: 'POST', url: 'https://www.nhasea.org/Components/Member/Assets/AJAX/LogIn.php', dataType : 'text', // data type data : vals, success: function(msg){ var ret = msg.split('::'); if (ret[0] == 1) { $('#loginMessage').html('