I used this code from phpacademy but i cant seem to get it to work, i'm new to javascript, i'm more on the php and css side of coding. So is there an error of some sort?
This is the regular page:
Code:
<head>
<script type="text/javascript">
$(document).ready(function() {
$('#getthis').load('checkinfo.php').show();
$('#username').keyup(function() {
$.post('checkinfo.php', { username: form.username.value },
function(result) {
$('#getthis').html(result).show();
});
});
});
</script>
</head>
<body>
<form method='post'>
Username: <input type='text' name='username' id='username' size='30' maxlength='25'> <div id='getthis'> </div>
</form>
</body>
and this is the checkinfo.php:
Code:
<?php
echo "$username = $_POST['username'];"
?>