I really struggle with jQuery so just stick with me.
It doesn't work. When I click the button nothing happens.Code:<script type="text/javascript"> jQuery(function($){ var field1 = $('#loginUser'); var field2 = $('#loginPass'); $('#loginSubmit').click(function(){ jQuery.ajax({ url: '<?php echo $host; ?>login.php', type: 'post', data: 'field1value=' + field1.value() + '&field2value=' + field2.value, success: function(results){ alert(results); alert("hi"); } }); }); }); </script> <form> <input type="text" name="username" id="loginUser" value="Username" onclick="clear1(this)" onblur="fill1(this)"> <input type="text" name="password" id="loginPass" value="Password" onclick="clear2(this)" onblur="fill2(this)"> <input type="button" name="loginSubmit" id="loginSubmit" value="Log In" Style="background-color:brown;border:none;"> </form>
Any help?



Reply With Quote

Bookmarks